Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the property audioTracks that returns the AudioTrackList object in html5

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you how to use the property audioTracks that returns the AudioTrackList object in html5. I hope you will get something after reading this article. Let's discuss it together.

Example

Get the number of available tracks:

MyVid=document.getElementById ("video1"); alert (myVid.audioTracks.length)

Definition and usage

The audioTracks property returns the AudioTrackList object.

The AudioTrackList object represents the available tracks for audio and video.

Each available track is represented by an AudioTrack object.

Browser support

The audioTracks attribute is not supported by any major browser.

Grammar

Audio | video.audioTracks type description AudioTrackList object

Represents the available tracks for audio and video.

AudioTrackList object:

AudioTracks.length-or the number of available tracks

AudioTracks.getTrackById (id)-get the AudioTrack object through id

AudioTracks [index]-get the AudioTrack object through index

Note: the subscript of the first available AudioTrack object is 0.

AudioTrack object

Represents the track.

Properties of the AudioTrack object:

Id-get the id of the track

Kind-gets the type of track (can be "alternative", "description", "main", "translation", "commentary", or "" (empty string))

Label-get the label of the track

Language-the language of access to audio tracks

Enabled-gets or sets whether the track is active (true | false)

Example

Get the number of available audio tracks:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report