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 for the mute event. The event handler function receives a single parameter: the event object, which is a simple Event object.
In this example, an 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;";
};
| Specification | Status | Comment |
|---|---|---|
| Media Capture and Streams The definition of 'MediaStreamTrack.onmute' in that specification. | Candidate Recommendation | Initial specification. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | Yes | 12 | 59 | No | Yes | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Yes | Yes | Yes | 59 | Yes | ? | Yes |
mute event and its type, Event.MediaStreamTrack.muted to determine if a track is currently mutedMediaStreamTrack.onunmute, the event handler for the unmute event.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/onmute