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.
Syntax
track.onmute = muteHandler;
Value
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.
Example
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;";
};
Specifications
| Specification | Status | Comment |
|---|---|---|
| Media Capture and Streams The definition of 'MediaStreamTrack.onmute' in that specification. |
Candidate Recommendation | Initial specification. |
Browser compatibility
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.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onmute | Chrome Full support Yes | Edge Full support 12 | Firefox Full support 59 | IE No support No | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 59 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
See also
- The
muteevent and its type,Event. MediaStreamTrack.mutedto determine if a track is currently mutedMediaStreamTrack.onunmute, the event handler for theunmuteevent.
