这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

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.
候选推荐 最初的规范。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
onbufferedamountlow Chrome 57
57
默认为 rtcpMuxPolicy is require .
Edge ≤79
≤79
默认为 rtcpMuxPolicy is require .
Firefox Yes IE No Opera 44
44
默认为 rtcpMuxPolicy is require .
Safari Yes WebView Android 57
57
默认为 rtcpMuxPolicy is require .
Chrome Android 57
57
默认为 rtcpMuxPolicy is require .
Firefox Android Yes Opera Android 43
43
默认为 rtcpMuxPolicy is require .
Safari iOS No Samsung Internet Android 7.0
7.0
默认为 rtcpMuxPolicy is require .

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

见实现注意事项。

元数据

  • 最后修改: