We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

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!

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,