TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://docs.thewidlarzgroup.com/react-native-video/
MIT License
7.23k stars 2.9k forks source link

Subtitle and subtitle buttons are not display #3041

Open vishalhyperspace opened 1 year ago

vishalhyperspace commented 1 year ago

Hello I am implementing react-native-video in my tvOS app and need to display subtitle. but even after set text tracks it does not display subtitles and a subtitle buttons. here is my code for video player


 <Video
        ref={setPlayer}
        subtitle={true}
        source={{
          uri: configuration.url,
        }}
        style={[styles.playerLoaded]}
        controls={true}
        paused={pausedRef.current}
        onLoad={handleLoad}
        resizeMode={'contain'}
        rate={playerRate}
        onProgress={handleProgress}
        onError={onError}
        onLoadStart={onLoadStart}
        onSeek={handleSeek}
        onReadyForDisplay={onReadyForDisplay}
        onEnd={onEndVideo}
        playInBackground={false}
        playWhenInactive={false}
        selectedTextTrack={{
          type: 'language',
          value: 'en',
        }}
        textTracks={[
          {
            title: 'English CC',
            language: 'en',
            type: TextTrackType.VTT, // "text/vtt"
            uri: 'https://captions.cloud.vimeo.com/captions/13026836.vtt?expires=1676898663&sig=429c369ce4b16ca4786bc94a6a893eb245363ebd',
          },
          {
            title: 'Spanish Subtitles',
            language: 'es',
            type: TextTrackType.SRT, // "application/x-subrip"

            uri: 'https://captions.cloud.vimeo.com/captions/13026836.vtt?expires=1676898663&sig=429c369ce4b16ca4786bc94a6a893eb245363ebd',
          },
        ]}
      />

here is my URI for subtitle files: "https://captions.cloud.vimeo.com/captions/13026836.vtt?expires=1676898663&sig=429c369ce4b16ca4 786bc94a6a893eb245363ebd"

you can see button is not showing in my video players: simulator_screenshot_D44AD12E-A873-4A31-B390-8A06B9701740

I am using react-native-video version 5.2.1 Please help me to figure it out. Thanks in advance.

BraveEvidence commented 1 year ago

This will help https://www.youtube.com/watch?v=vVI7ZAZq5e0