Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for local subtitles/textTrack #1864

Closed
ysrarff opened this issue Jan 5, 2020 · 3 comments
Closed

Support for local subtitles/textTrack #1864

ysrarff opened this issue Jan 5, 2020 · 3 comments
Labels
stale Closed due to inactivity or lack or resources

Comments

@ysrarff
Copy link

ysrarff commented Jan 5, 2020

Feature Request

Support for local subtitles/textTrack

Why it is needed

This feature could possibly avoid devs from having to do any complex video processing tasks for simple use cases such as rendering texts on videos (E.G. avoid setting up and using react-native-unimodules and react-gl)

Possible implementation

Hi, great plugin you guys have here, the documentation was clear and integrating it into my project was a breeze. Anyway, I would like to know if there would be a future support for locally adding subtitles to the video. In this case, I have my local subtitle (.VTT) file generated from react-native-fs and I tested it and it didn't work but using external .VTT files hosted on a remote server such as this one works!

Code sample

const getFile = await RNFS.readDir(RNFS.DocumentDirectoryPath);
const file = getFile[0].path; // <--- path to local subtitle

...


<Video
    source={{ uri: this.state.uri }}
    style={style.videoPlayback}
    repeat={true}
    textTracks={[
            {
                title: "English CC",
                language: "en",
                type: TextTrackType.VTT, // "text/vtt"
                uri: file // ...or implement something along the lines of require(file)
            },
        ]}
    selectedTextTrack={{ type: 'title', value: "English CC" }}
/>
@shababcreative
Copy link

Local subtitles files work fine for me, make sure your app have storage permission, I even added support for .ass files by converting it to .vtt using react-native-ffmpeg

@cgtarmenta
Copy link

@shababcreative what about embedded srt tracks?

@davekedar
Copy link

Will this work on version 61 or above?

@hueniverse hueniverse added the stale Closed due to inactivity or lack or resources label Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Closed due to inactivity or lack or resources
Projects
None yet
Development

No branches or pull requests

5 participants