docs: update the TextTrackType enum (#4216)

* chore: update the document

* chore: update the document
This commit is contained in:
Seyed Mostafa Hasani 2024-10-05 12:50:54 +03:30 committed by GitHub
parent 0820f8167f
commit 74fb44ddcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -879,19 +879,18 @@ source={{
``` ```
#### `textTracks` #### `textTracks`
<PlatformsList types={['Android', 'iOS', 'visionOS']} /> <PlatformsList types={['Android', 'iOS', 'visionOS']} />
Load one or more "sidecar" text tracks. This takes an array of objects representing each track. Each object should have the format: Load one or more "sidecar" text tracks. This takes an array of objects representing each track. Each object should have the format:
> ⚠️ This feature does not work with HLS playlists (e.g m3u8) on iOS > ⚠️ This feature does not work with HLS playlists (e.g m3u8) on iOS
| Property | Description | | Property | Description |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| title | Descriptive name for the track | | title | Descriptive name for the track |
| language | 2 letter [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) representing the language | | language | 2 letter [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) representing the language |
| type | Mime type of the track _ TextTrackType.SRT - SubRip (.srt) _ TextTrackType.TTML - TTML (.ttml) \* TextTrackType.VTT - WebVTT (.vtt)iOS only supports VTT, Android supports all 3 | | type | Mime type of the track _ TextTrackType.SUBRIP - SubRip (.srt) _ TextTrackType.TTML - TTML (.ttml) \* TextTrackType.VTT - WebVTT (.vtt)iOS only supports VTT, Android supports all 3 |
| uri | URL for the text track. Currently, only tracks hosted on a webserver are supported | | uri | URL for the text track. Currently, only tracks hosted on a webserver are supported |
On iOS, sidecar text tracks are only supported for individual files, not HLS playlists. For HLS, you should include the text tracks as part of the playlist. On iOS, sidecar text tracks are only supported for individual files, not HLS playlists. For HLS, you should include the text tracks as part of the playlist.
@ -912,7 +911,7 @@ textTracks={[
{ {
title: "Spanish Subtitles", title: "Spanish Subtitles",
language: "es", language: "es",
type: TextTrackType.SRT, // "application/x-subrip" type: TextTrackType.SUBRIP, // "application/x-subrip"
uri: "https://durian.blender.org/wp-content/content/subtitles/sintel_es.srt" uri: "https://durian.blender.org/wp-content/content/subtitles/sintel_es.srt"
} }
]} ]}
@ -971,12 +970,12 @@ Load one or more "sidecar" text tracks. This takes an array of objects represent
> ⚠️ This feature does not work with HLS playlists (e.g m3u8) on iOS > ⚠️ This feature does not work with HLS playlists (e.g m3u8) on iOS
| Property | Description | | Property | Description |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| title | Descriptive name for the track | | title | Descriptive name for the track |
| language | 2 letter [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) representing the language | | language | 2 letter [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) representing the language |
| type | Mime type of the track _ TextTrackType.SRT - SubRip (.srt) _ TextTrackType.TTML - TTML (.ttml) \* TextTrackType.VTT - WebVTT (.vtt)iOS only supports VTT, Android supports all 3 | | type | Mime type of the track _ TextTrackType.SUBRIP - SubRip (.srt) _ TextTrackType.TTML - TTML (.ttml) \* TextTrackType.VTT - WebVTT (.vtt)iOS only supports VTT, Android supports all 3 |
| uri | URL for the text track. Currently, only tracks hosted on a webserver are supported | | uri | URL for the text track. Currently, only tracks hosted on a webserver are supported |
On iOS, sidecar text tracks are only supported for individual files, not HLS playlists. For HLS, you should include the text tracks as part of the playlist. On iOS, sidecar text tracks are only supported for individual files, not HLS playlists. For HLS, you should include the text tracks as part of the playlist.
@ -997,7 +996,7 @@ textTracks={[
{ {
title: "Spanish Subtitles", title: "Spanish Subtitles",
language: "es", language: "es",
type: TextTrackType.SRT, // "application/x-subrip" type: TextTrackType.SUBRIP, // "application/x-subrip"
uri: "https://durian.blender.org/wp-content/content/subtitles/sintel_es.srt" uri: "https://durian.blender.org/wp-content/content/subtitles/sintel_es.srt"
} }
]} ]}