Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLMediaElement
  4. audioTracks

HTMLMediaElement: audioTracks property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The read-onlyaudioTracksproperty onHTMLMediaElement objects returnsanAudioTrackList object listing all of theAudioTrackobjects representing the media element's audio tracks.

The media element may beeither an<audio> element or a<video> element.

The returned list islive; that is, as tracks are added to and removed fromthe media element, the list's contents change dynamically. Once you have a reference tothe list, you can monitor it for changes to detect when new audio tracks are added orexisting ones removed. SeeAudioTrackList eventsto learn more about watching for changes to a media element's track list.

Value

AnAudioTrackList object representing the list of audio tracks includedin the media element. The list of tracks can be accessed using array notation, or usingthe object'sgetTrackById() method.

Each track is represented by anAudioTrack object which providesinformation about the track.

Examples

In this example, all of the audio tracks on a given element are muted.

HTML

The HTML establishes the element itself.

html
<video src="somevideo.mp4"></video>

JavaScript

The JavaScript code handles muting the video element's audio tracks.

js
const video = document.getElementById("video");for (const track of video.audioTracks) {  track.enabled = false;}

Specifications

Specification
HTML
# dom-media-audiotracks-dev

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp