RTCRtpEncodingParameters
dictionary's
scaleResolutionDownBy
property can be used to specify a factor by which to reduce the size of a video track during encoding.
This property is only available for tracks whose
kind
is
视频
.
rtpEncodingParameters.scaleResolutionDownBy = scalingFactor;
rtpEncodingParameters = {
scaleResolutionDownBy: scalingFactor
};
A double-precison floating-point number specifying the amount by which to reduce the size of the video during encoding. The default value, 1.0, means that the video will be encoded at its original size. A value of 2.0 would reduce the size of the video by a factor of 2 both horizontally and vertically, resulting in a video 25% the original size.
A value less than 1.0 would cause the video to get larger rather than smaller, which is not the intent of this property. Therefore, specifying a value less than 1.0 is not permitted and will cause a
RangeError
exception to be thrown by
RTCPeerConnection.addTransceiver()
or
RTCRtpSender.setParameters()
.
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCRtpEncodingParameters.scaleResolutionDownBy' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
scaleResolutionDownBy
|
Chrome 74 | Edge No | Firefox 46 | IE No | Opera ? | Safari ? | WebView Android 74 | Chrome Android 74 | Firefox Android 46 | Opera Android ? | Safari iOS ? | Samsung Internet Android 11.0 |
完整支持
不支持
兼容性未知
RTCRtpEncodingParameters
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent