mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-06-06 20:12:54 +00:00
feat(ios): allow to side load subtitles when playing hls stream (#4593)
This commit is contained in:
+16
-1
@@ -21,6 +21,7 @@ import {
|
||||
type onProgressData,
|
||||
type ResizeMode,
|
||||
type TextTrack,
|
||||
type VideoConfig,
|
||||
type VideoPlayerStatus,
|
||||
type VideoViewRef,
|
||||
} from 'react-native-video';
|
||||
@@ -407,7 +408,21 @@ const VideoDemo = () => {
|
||||
onPress={() => {
|
||||
const newSource = {
|
||||
uri: 'https://playertest.longtailvideo.com/adaptive/elephants_dream_v4/index.m3u8',
|
||||
};
|
||||
externalSubtitles: [
|
||||
{
|
||||
uri: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt',
|
||||
label: 'External English',
|
||||
language: 'en',
|
||||
type: 'vtt',
|
||||
},
|
||||
{
|
||||
uri: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_fr.vtt',
|
||||
label: 'External French',
|
||||
language: 'External French',
|
||||
type: 'vtt',
|
||||
},
|
||||
],
|
||||
} satisfies VideoConfig;
|
||||
player.replaceSourceAsync(newSource);
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user