草案
此页面不完整。

过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

TrackDefault() constructor of the TrackDefault interface constructs and returns a new TrackDefault 对象。

句法

var trackDefault = new TrackDefault(type, language, label, kinds, byteStreamTrackID);
					

参数

type
DOMString specifying a media segment data type for the SourceBuffer to contain. Can be audio , 视频 ,或 text .
语言
DOMString specifying a default language for the SourceBuffer to use when an initialization segment does not contain language information for a new track.
label
DOMString specifying a default label for the SourceBuffer to use when an initialization segment does not contain label information for a new track.
kinds
An array (sequence) of DOMString s specifying default kinds for the SourceBuffer to use when an initialization segment does not contain kind information for a new track.
byteStreamTrackID 可选
DOMString specifying the ID of the specific track that the SourceBuffer should apply to. If not specified, this value will be an empty string and the SourceBuffer can contain any tracks of the specified type .

错误

when this constructor is invoked, the following errors can occur:

Error 解释
InvalidAccessError The supplied 语言 is not a valid language code, e.g. en-US .
TypeError there are values specified in the kinds array that do not apply to the specified type .

范例

TBD

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
TrackDefault() 构造函数 非标 Chrome ? Edge ≤18 Firefox 不支持 No IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Firefox Android 不支持 No Opera Android ? Safari iOS 不支持 No Samsung Internet Android ?

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

非标。预期跨浏览器支持较差。

另请参阅

元数据

  • 最后修改: