这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
RTCDataChannel.onbufferedamountlow
property is an
EventHandler
which specifies a function the browser calls when the
bufferedamountlow
event is sent to the
RTCDataChannel
. This event, which is represented by a simple
事件
object, is sent when the amount of data buffered to be sent falls to or below the threshold specified by the channel's
bufferedAmountLowThreshold
.
见 Buffering in Using WebRTC data channels to learn more about how to work with the data channel buffer.
RTCDataChannel.onbufferedamountlow = function;
A function which the browser will call to handle the
bufferedamountlow
event. This function receives as its only input parameter a simple
事件
object representing the event which has occurred.
This example responds to the
bufferedamountlow
event by fetching up to 64kB of a file represented by an object
source
and calling
RTCDataChannel.send()
to queue up the retrieved data for sending on the data channel.
pc = new RTCPeerConnection();
dc = pc.createDataChannel("SendFile");
/* ... */
dc.onbufferedamountlow = function() {
if (source.position <= source.length) {
dc.send(source.readFile(65536));
}
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCDataChannel.onbufferedamountlow' in that specification. |
候选推荐 | 最初的规范。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onbufferedamountlow
|
Chrome
57
|
Edge
≤79
|
Firefox Yes | IE No |
Opera
44
|
Safari Yes |
WebView Android
57
|
Chrome Android
57
|
Firefox Android Yes |
Opera Android
43
|
Safari iOS No |
Samsung Internet Android
7.0
|
完整支持
不支持
实验。期望将来行为有所改变。
见实现注意事项。
RTCDataChannel
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent