HTMLMediaElement.videoTracks

您正在阅读此内容的英文版本,因为该语系尚未翻译。 帮助我们翻译此文章吧!

草案
本页尚未完工.

 videoTracks 为 HTMLMediaElement 的只读属性,它是一个 VideoTrackList 列表,列表中包含相应媒体元素的视频轨, 视频轨为VideoTrack 类型对象。

它是一个实时列表; 当相应的媒体元素增加或删除视频轨时,返回列表会发生动态的改变。由此你可以监控和检测视频轨发生的变化。学习 Event handlers in VideoTrackList 可以获得更多关于media element 视频轨的知识.

Syntax

var videoTracks = mediaElement.videoTracks;

返回值

返回的是一个VideoTrackList 类型值,为相应媒体元素的视频轨列表。可以用访问数组的方法访问这个值,或 getTrackById() 方法访问它.

列表中包含的每一个 VideoTrack 代表其中的一个视频轨。

Specifications

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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
videoTracksChrome No support NoEdge Full support 12Firefox Full support 33
Disabled
Full support 33
Disabled
Disabled From version 33: this feature is behind the media.track.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE ? Opera ? Safari Full support YesWebView Android ? Chrome Android ? Firefox Android Full support 33
Disabled
Full support 33
Disabled
Disabled From version 33: this feature is behind the media.track.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
User must explicitly enable this feature.
User must explicitly enable this feature.

See also