TheWidlarzGroup / react-native-video

A <Video /> component for react-native
http://thewidlarzgroup.github.io/react-native-video/
MIT License
7.14k stars 2.88k forks source link

[ANDROID] Subtitle not working even after exoplayer became default #4069

Closed Khafaga39 closed 1 week ago

Khafaga39 commented 1 month ago

Version

^6.4.3

What platforms are you having the problem on?

Android

System Version

0.74.0

On what device are you experiencing the issue?

Real device, Simulator

Architecture

New architecture with interop layer

What happened?

Subtitle not working even after exoplayer became default in android, but in IOS working perfectly. code : textTracks={[ { title: 'English CC', language: 'en', type: 'text/vtt', uri: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt', }, ]} selectedTextTrack={{ type: showFullScreen ? 'title' : 'disabled', value: showFullScreen ? 'English CC' : '', }}

versions: "react-native": "0.74.0" "react-native-video": "^6.4.3",

Reproduction

repository link

Reproduction

Step to reproduce this bug are:

  1. install the latest package
  2. added textTracks & selectedTextTrack props in Video
moskalakamil commented 1 month ago

Hi! Thanks for reporting issue. We'll try to fix it as fast as possible.

personalnadir commented 1 week ago

I'm seeing the same issue - text tracks working on iOS, but not Android

freeboub commented 1 week ago

The issue is in selection by title. if you use index or language, it is work (but OK, selection by title should also work). I will have a look

freeboub commented 1 week ago

I just push a patch to fix the issue, if you want to have a look and test ?!

personalnadir commented 1 week ago

Thanks, I've copied the change into 6.4.5, but I've found that I still don't see the subtitles on Android. I've also tested using index, but that's not worked for me either. When I opened the DefaultTrackSelector source code in Android studio I did get a message that Library source does not match the bytecode for class. Could that be the root of the matter?

freeboub commented 1 week ago

@personalnadir I think your android studio is not well synchronized with gradle. Please open the android folder on android studio and try to build your project with it. Another point, you should be able to test it with the sample/basic in the project....

personalnadir commented 1 week ago

@freeboub I've tried various combinations of Invalidating Caches, gradlew cleans and rebuilds as well as removing and reinstalling react-native-video and cannot get the Library source error to vanish or the subtitles to appear. Does build fine though

There seems to be other people who have that problem with Exoplayer https://github.com/google/ExoPlayer/issues/7394