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
| Specification | Status | Comment |
|---|---|---|
| Media Capture and Streams The definition of 'MediaStreamTrack.onunmute' 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 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onunmute | 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
unmuteevent and its type,Event. MediaStreamTrack.mutedto determine if a track is currently mutedMediaStreamTrack.onmute, the event handler for themuteevent.
