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

Fix sideload text track issues on iOS #1157

Merged
merged 1 commit into from
Jul 31, 2018
Merged

Conversation

cobarx
Copy link
Contributor

@cobarx cobarx commented Jul 30, 2018

This PR is designed to fix #1155.

While investigating this, I discovered the code would cause text tracks to be displayed even if the type was set to "disabled". I've refactored the code so that we only look for text tracks matching the device language if the type is "system".

@cobarx
Copy link
Contributor Author

cobarx commented Jul 30, 2018

@ashnfb I can't figure out how to make it so all text tracks get disabled. The code to loop through all the tracks and update the enabled status works fine as long as we enable at least one track. But if I setEnabled:NO for all of them, the text for the most recently selected track gets stuck on the screen and never disappears. Any ideas how we can tackle this? I've looked all over Stack Overflow and can't find anything.

Here's the relevant code:

  for (int i = firstTextIndex; i < _player.currentItem.tracks.count; ++i) {
    BOOL isEnabled = NO;
    if (selectedTrackIndex != RCTVideoUnset) {
      isEnabled = i == selectedTrackIndex + firstTextIndex;
    }
    [_player.currentItem.tracks[i] setEnabled:isEnabled];
  }

@cobarx
Copy link
Contributor Author

cobarx commented Jul 30, 2018

I posted a Stack Overflow question to see if I can get some info on how to tackle this:
https://stackoverflow.com/questions/51585932/how-do-you-disable-all-text-tracks-in-an-avmutablecomposition

@cobarx cobarx merged commit 352bad2 into master Jul 31, 2018
@cobarx cobarx deleted the bugfix/disable-sideload-track branch July 31, 2018 21:03
@ashnfb
Copy link
Contributor

ashnfb commented Jul 31, 2018

@cobarx going to have a look at these issues today and tomorrow, plus the onLoad changes suggested

@cobarx
Copy link
Contributor Author

cobarx commented Jul 31, 2018

@ashnfb Ok, thanks man. I've asked a friend who's pretty familiar with AVPlayer how to tackle this, but I haven't heard back from him yet.

@cvaldezscse
Copy link

@cobarx Does someone looking at this issue? i can help you if you tell me where to start from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextTrack gets picked up on Android but not on iOS
3 participants