React-native-video: Android: TextTrack selector issue. TextTrack not going away after turning them on and then off.

Created on 27 Jul 2018  路  3Comments  路  Source: react-native-video/react-native-video

Current behavior

I'm using the the TextTrack selector functionality that was added not so long ago. It's working fine in iOS, but on Android, I select the one I want, but then if I try to turn it off (by passing null to the selectedTextTrack prop) the track that was previously selected doesn't go away.

Reproduction steps

  1. Play a video on Android that has text tracks.
  2. Select a text track.
  3. Try removing the text track by passing null to the selectedTextTrack prop.

Expected behavior

The previously selected text track should go away.

Platform

Which player are you experiencing the problem on:

  • Android ExoPlayer
  • Android MediaPlayer

Most helpful comment

@shlokamin that worked, thanks man!

All 3 comments

If you're just trying to turn the captions off, try setting the selectedTextTrack type to 'disabled':

selectedTextTrack={{
type: "disabled",
value: "should_not_matter"
}}

This is what I do in my app through a toggle button.

@shlokamin that worked, thanks man!

Got a similar issue on iOS.
When I remove the subtitles using the above method, the last subtitle stays on screen.
If I remove it when there is no subtitles it's fine.
Also if I disable subtitles, go fullscreen and come back the subtiles are gone (as it should).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shahen94 picture shahen94  路  3Comments

joshyg picture joshyg  路  3Comments

gogoku picture gogoku  路  3Comments

zachrnolan picture zachrnolan  路  3Comments

jmrhvl picture jmrhvl  路  3Comments