MediaStreamTrack.onunmute
MediaStreamTrack's onunmute event handler is called when the unmute event is received. Such an event is sent when the track is again able to send data.
When the onunmute event handler is called, the track's muted flag is false.
Syntax
track.onunmute = unmuteHandler;
Value
unmuteHandler is a function which is called when the MediaStreamTrack receives the unmute event. The event handler receives as input a single parameter: an Event whose kind is "unmute".
Example
This example creates an unmute event handler which changes the state of a visual indicator to display the Emoji character representing a "speaker" icon.
myTrack.onunmute = function(evt) { playStateIcon.innerHTML = "🔈"; };
Specifications
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 | |
onunmute |
Yes |
12 |
59 |
No |
Yes |
11 |
Yes |
Yes |
59 |
Yes |
11 |
Yes |
See also
- The
unmuteevent and its type,Event. -
MediaStreamTrack.mutedto determine if a track is currently muted -
MediaStreamTrack.onmute, the event handler for theMediaStreamTrack.mute_eventevent.
© 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/onunmute