TheWidlarzGroup / react-native-video

A <Video /> component for react-native
MIT License
7.1k stars 2.86k forks source link

Android Subtitles SRT not working for me #1737

Closed naeemqaswar closed 4 years ago

naeemqaswar commented 4 years ago

Current behavior

Hi @cobarx I'm trying to use textTracks to load .srt subtitle with video but unfortunately, video is loading and working fine but subtitles are not showing up in any case, have tried almost every possible way of implementation. Scope of my project is to use this player to run multiple videos, targeting AndroidTV and AppleTV.

Reproduction Steps

Video: https://s3.amazonaws.com/irt-media/iris/videos/772.360p.mp4 Subtitles: https://roku.itsrelevant.tv/roku/subtitles?chars=50&video_id=592

Code Implementation:

<Video
    ref={videoRef => (this.videoRef = videoRef)}
    useTextureView={false}
    source={{uri: 'https://publish.dvlabs.com/democracynow/360/dn2018-0720.mp4'}}
    resizeMode="contain"
    style={styles.fullScreen}
    selectedTextTrack={{
        type: 'title',
        value: 'English',
    }}
    textTracks={[
        {
            title: 'English',
            language: 'es',
            type: TextTrackType.SRT,
            uri: 'https://roku.itsrelevant.tv/roku/subtitles?chars=50&video_id=592',
        },
    ]}
/>

Expected behavior

TextTracks i.e SRT should be displayed with video play

Platform

naeemqaswar commented 4 years ago

Fixed it by changing the default player to "android-exoplayer" at /android/settings.gradle

hiteshtSociosquares commented 3 years ago

subtitle nt display for me, i follow given steps

hiteshtSociosquares commented 3 years ago

Fixed it by changing the default player to "android-exoplayer" at /android/settings.gradle

not wrking for me

rockushal3 commented 2 years ago

I solved this by adding a react-native.config.js file to root of my project with: module.exports = { dependencies: { 'react-native-video': { platforms: { android: { sourceDir: '../node_modules/react-native-video/android-exoplayer', }, }, }, }, };