Draft
This page is not complete.
Obsolete
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.
The TrackDefault()
constructor of the TrackDefault
interface constructs and returns a new TrackDefault
object.
Syntax
var trackDefault = new TrackDefault(type, language, label, kinds, byteStreamTrackID);
Parameters
- type
- A
DOMString
specifying a media segment data type for theSourceBuffer
to contain. Can beaudio
,video
, ortext
. - language
- A
DOMString
specifying a default language for theSourceBuffer
to use when an initialization segment does not contain language information for a new track. - label
- A
DOMString
specifying a default label for theSourceBuffer
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 theSourceBuffer
to use when an initialization segment does not contain kind information for a new track. - byteStreamTrackID Optional
- A
DOMString
specifying the ID of the specific track that theSourceBuffer
should apply to. If not specified, this value will be an empty string and theSourceBuffer
can contain any tracks of the specifiedtype
.
Errors
when this constructor is invoked, the following errors can occur:
Error | Explanation |
---|---|
InvalidAccessError |
The supplied language 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 . |
Example
TBD
Browser compatibility
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.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
TrackDefault() constructor | Chrome ? | Edge Full support ≤18 | Firefox No support No | IE ? | Opera ? | Safari ? | WebView Android ? | Chrome Android ? | Firefox Android No support No | Opera Android ? | Safari iOS No support No | Samsung Internet Android ? |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.