From f6e1079e572b35765837e8af4bb8b93e718b8aba Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Wed, 11 Jul 2018 09:09:56 -0700 Subject: [PATCH 1/3] Document textTracks support for iOS --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 76301dff..2b8dde0b 100644 --- a/README.md +++ b/README.md @@ -402,7 +402,7 @@ Property | Description --- | --- 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 -type | Mime type of the track
* TextTrackType.SRT - .srt SubRip Subtitle
* TextTrackType.TTML - .ttml TTML
* TextTrackType.VTT - .vtt WebVTT +type | Mime type of the track
* TextTrackType.SRT - SubRip (.srt)
* TextTrackType.TTML - TTML (.ttml)
* TextTrackType.VTT - WebVTT (.vtt)
Android supports all 3 types, iOS only supports VTT uri | URL for the text track. Currently, only tracks hosted on a webserver are supported Example: @@ -413,21 +413,21 @@ textTracks={[ { title: "English CC", language: "en", - type: "text/vtt", TextTrackType.VTT, + type: TextTrackType.VTT, // "text/vtt" uri: "https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt" }, { title: "Spanish Subtitles", language: "es", - type: "application/x-subrip", TextTrackType.SRT, + type: TextTrackType.SRT, // "application/x-subrip" uri: "https://durian.blender.org/wp-content/content/subtitles/sintel_es.srt" } ]} ``` -This isn't support on iOS because AVPlayer doesn't support it. Text tracks must be loaded as part of an HLS playlist. +On iOS, sidecar text tracks are not supported for HLS playlists. For HLS playlists, you should include the text tracks as part of the playlist. -Platforms: Android ExoPlayer +Platforms: Android ExoPlayer, iOS #### useTextureView Output to a TextureView instead of the default SurfaceView. In general, you will want to use SurfaceView because it is more efficient and provides better performance. However, SurfaceViews has two limitations: From 4cdeebea65eace4b81804b0511b3bf276085d312 Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Wed, 11 Jul 2018 09:22:24 -0700 Subject: [PATCH 2/3] Cleanup up iOS textTracks explanation --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b8dde0b..19b4371d 100644 --- a/README.md +++ b/README.md @@ -402,9 +402,11 @@ Property | Description --- | --- 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 -type | Mime type of the track
* TextTrackType.SRT - SubRip (.srt)
* TextTrackType.TTML - TTML (.ttml)
* TextTrackType.VTT - WebVTT (.vtt)
Android supports all 3 types, iOS only supports VTT +type | Mime type of the track
* TextTrackType.SRT - SubRip (.srt)
* TextTrackType.TTML - TTML (.ttml)
* TextTrackType.VTT - WebVTT (.vtt)
iOS only supports VTT, Android ExoPlayer supports all 3 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. + Example: ``` import { TextTrackType }, Video from 'react-native-video'; @@ -425,7 +427,6 @@ textTracks={[ ]} ``` -On iOS, sidecar text tracks are not supported for HLS playlists. For HLS playlists, you should include the text tracks as part of the playlist. Platforms: Android ExoPlayer, iOS From 3d4c36ea4ec5821ed02d2b6eccca1575d0e9257a Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Wed, 11 Jul 2018 09:23:39 -0700 Subject: [PATCH 3/3] Add entry for iOS textTracks --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c6d5078..d649ccec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog +### Next Version +* Support sidecar text tracks on iOS [#1109](https://github.com/react-native-community/react-native-video/pull/1109) + ### Version 3.0 * Inherit Android buildtools and SDK version from the root project [#1081](https://github.com/react-native-community/react-native-video/pull/1081) * Automatically play on ExoPlayer when the paused prop is not set [#1083](https://github.com/react-native-community/react-native-video/pull/1083)