Returns true if the given track is active, and false otherwise. Can be set, to change whether the track is enabled or not. If multiple audio tracks are enabled simultaneously, they are mixed.
Property of apis/audio-video/AudioTrackapis/audio-video/AudioTrack
Syntaxvar result = AudioTrack.enabled;
AudioTrack.enabled = value;
Return Value
Returns an object of type BooleanBoolean
Examples(function () {
var video = document.getElementById("video");
video.addEventListener("loadeddata", function () {
var audioTracks = video.audioTracks;
var tracksSelection = document.getElementById("tracksSelection");
for (var i = 0; i < audioTracks.length; i++) {
var opt = document.createElement('option');
opt.value = audioTracks[i].id;
opt.text = audioTracks[i].language;
tracksSelection.add(opt);
}
});
tracksSelection.addEventListener("change", function (e) {
var audioTracks = video.audioTracks;
var track = audioTracks.getTrackById(e.currentTarget.value);
for (var i = 0; i < audioTracks.length; i++) {
audioTracks.enabled = false;
}
track.enabled = true;
});
})();
Related specifications
enabled
enabled
Microsoft Developer Network: Windows Internet Explorer API reference Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4