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

Videos Without Text Tracks Should Be Cached #1387

Conversation

brendangkchan
Copy link

The documentation and code logs both say that caching should be bypassed if there are text tracks, however the code says the opposite. This PR fixes such that caching works as expected when there are no text tracks.

In the code the if statement checks that there are NO text tracks:
https://github.com/react-native-community/react-native-video/blob/master/ios/Video/RCTVideo.m#L483

However the debug log inside the if statement says there ARE text tracks:
https://github.com/react-native-community/react-native-video/blob/master/ios/Video/RCTVideo.m#L488

@brendangkchan brendangkchan changed the title Bug/no texttracks bypass cache Videos Without Text Tracks Should Be Cached Dec 15, 2018
@cobarx
Copy link
Contributor

cobarx commented Feb 19, 2019

@n1ru4l Can you take a look at this. It looks like the code in has been updated, but I'm the logic is throwing me off a bit...should we be checking for _textTracks set or not set?

@cobarx
Copy link
Contributor

cobarx commented Mar 13, 2019

@n1ru4l Any thoughts on this?

@n1ru4l
Copy link
Contributor

n1ru4l commented Mar 14, 2019

@cobarx Yes it makes sense to only cache if _textTracks is empty or nullish.

@danielmarino24i
Copy link
Contributor

danielmarino24i commented Mar 14, 2019

So if I understand correctly, it is already working on master

if (shouldCache && (!_textTracks || !_textTracks.count)) {

playerItemForSourceUsingCache:uri is only being called if shouldCache = true and has no textTracks

@cobarx
Copy link
Contributor

cobarx commented Mar 15, 2019

@danielmarino24i I'm going to close this then. I think this problem got addressed by the change from @n1ru4l that added that code to master.

@cobarx cobarx closed this Mar 15, 2019
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.

4 participants