MDN wants to talk to developers like you: https://qsurvey.mozilla.com/s3/8d22564490d8

HTMLMediaElement.audioTracks

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

语法

audio|video.audioTracks

返回值

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

用例

以audio标签为例

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

调用

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

参考文档

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

HTML5
HTMLMediaElement.audioTracks

Recommendation Initial definition.

浏览器支持

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) ? ? ?

还可以看看

文档标签和贡献者

 此页面的贡献者: haocity, hjb2722404, young3578671
 最后编辑者: haocity,