HTMLMediaElement.audioTracks

 HTMLMediaElement.audioTracks 获得可用音频轨道的数量

语法

audio|video.audioTracks

返回值

AudioTrackList    对象 表示音频/视频的可用音频轨道

用例

以audio标签为例

<audio id='audio'></audio>

调用

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

参考文档

Specification Status Comment
HTML Living Standard
HTMLMediaElement.audioTracks
Living Standard No change from HTML5

HTML5
HTMLMediaElement.audioTracks

Recommendation Initial definition.

浏览器支持

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help! (en-US)

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
audioTracks property ? 33.0 (33.0)[5] ? ? ?
Feature Android Firefox Mobile (Gecko) Firefox OS (Gecko) IE Mobile Opera Mobile Safari Mobile
audioTracks property ? 33.0 (33.0)[5] (Yes) ? ? ?

还可以看看