MediaStreamTrack.onmute
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 event handler 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 |
|---|
| Media Capture and Streams # dom-mediastreamtrack-onmute |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
onmute |
Yes |
12 |
59 |
No |
Yes |
11 |
Yes |
Yes |
59 |
Yes |
11 |
Yes |
See also
- The
muteevent and its type,Event. -
MediaStreamTrack.mutedto determine if a track is currently muted -
MediaStreamTrack.onunmute, the event handler for theunmuteevent.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/onmute