VideoTrackList.getTrackById()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
VideoTrackList
の getTrackById()
メソッドは、指定された文字列と id
が一致するトラックリストから最初の VideoTrack
オブジェクトを返します。
ID 文字列がわかっていれば、これで特定のトラックを見つけることができます。
構文
js
getTrackById(id)
引数
id
-
文字列で、トラックリスト内で検索するトラックの ID を指定します。
戻り値
指定された文字列に一致する id
を持つ VideoTrackList
内で見つかった最初のトラックを示す VideoTrack
オブジェクト。 一致するものが見つからない場合、このメソッドは null
を返します。
トラックは自然な順序で検索されます。 つまり、メディアリソース自体によって定義された順序で、またはリソースが順序を定義していない場合は、メディアリソースによってトラックが宣言される相対的な順序です。
仕様書
Specification |
---|
HTML # dom-videotracklist-gettrackbyid-dev |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
getTrackById |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
- Has more compatibility info.
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.