MediaStreamTrack 's onmute event handler is called when the mute event is received. Such an event is sent when the track is temporarily not able to send data.

句法

track.onmute = muteHandler;
					

A function to serve as an EventHandler mute event. The event handler function receives a single parameter: the event object, which is a simple 事件 对象。

范例

在此范例中, onmute handler is established to set the content HTML of an element to display the "muted speaker" Emoji.

myTrack.onmute = function(evt) {
  playStateIcon.innerHTML = "F507;";
};
					

规范

规范 状态 注释
媒体捕获和流
The definition of 'MediaStreamTrack.onmute' 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
onmute Chrome Yes Edge 12 Firefox 59 IE No Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 59 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

另请参阅

元数据

  • 最后修改: