--- title: HTMLMediaElement.audioTracks slug: Web/API/HTMLMediaElement/audioTracks translation_of: Web/API/HTMLMediaElement/audioTracks ---
HTMLMediaElement.audioTracks
获得可用音频轨道的数量
audio|video.audioTracks
AudioTrackList 对象 表示音频/视频的可用音频轨道
以audio标签为例
<audio id='audio'></audio>
调用
myVid=document.getElementById("audio");
alert(myVid.audioTracks
.length);
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', "the-video-element.html#htmlmediaelement", "HTMLMediaElement.audioTracks")}} | {{Spec2('HTML WHATWG')}} | No change from {{SpecName('HTML5 W3C')}} |
{{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement.audioTracks")}} |
{{Spec2('HTML5 W3C')}} | Initial definition. |
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
audioTracks property |
{{CompatUnknown}} | {{CompatGeckoDesktop("33.0")}}[5] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | Firefox OS (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
audioTracks property |
{{CompatUnknown}} | {{CompatGeckoMobile("33.0")}}[5] | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |