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

TextTrack gets picked up on Android but not on iOS #1155

Closed
aecorredor opened this issue Jul 27, 2018 · 14 comments · Fixed by #1157
Closed

TextTrack gets picked up on Android but not on iOS #1155

aecorredor opened this issue Jul 27, 2018 · 14 comments · Fixed by #1157
Labels
stale Closed due to inactivity or lack or resources

Comments

@aecorredor
Copy link

Current behavior

The text track from my HLS videos get picked up on Android but not on iOS. The strange part is that before iOS was working fine (nothing changed on my code).

Reproduction steps

I am looking at the data that's coming back when onLoad triggers, this is how I was able to see the tracks for the same video coming back on Android but not on iOS.

Expected behavior

TextTracks get picked up both on iOS and Android.

Platform

Which player are you experiencing the problem on:

  • iOS
@cobarx
Copy link
Contributor

cobarx commented Jul 29, 2018

There were some changes to the text track code in 3.1.0. If you go back to 3.0.0, does that fix it? If so, the easiest way for me to diagnose this is if you can share the URL for your playlist. You can email me the info if it's not something you want public ([email protected])

@aecorredor
Copy link
Author

@cobarx Thanks for the quick reply. I'm actually on 3.0.0, never went up to 3.1.0. I'm going to test it now with a public HLS video to see if I still reproduce it and will let you know what happens.

@aecorredor
Copy link
Author

aecorredor commented Jul 30, 2018

@cobarx hey, so I tested it. I was always on 3.0.0. We never went to 3.1.0. The problem seems to be with the specific video I'm trying to play. I see the tracks on VLC and on an online HLS tester, but not on iOS. The data object that comes from the onLoad is empty. The weird thing is that Android does pick up the tracks. I'm going to go ahead and send you the playlist to your email to see if you're able to debug and maybe pinpoint the issue (it could be that the AVplayer doesn't pick up tracks for some videos).

@cobarx
Copy link
Contributor

cobarx commented Jul 30, 2018

Just tested the video you sent me, and the text tracks are showing up in onLoad and on screen. I wonder if you're running into an issue because this is an http stream. Can you check that you have Allow Arbitrary Loads enabled in your Info.plist file as described here:
https://github.com/react-native-community/react-native-video#additional-props

My guess is you enabled insecure streams on a domain by domain basis and the video domain is enabled, but the text one isn't. Pretty easy to miss. Lmk if that's it.

@aecorredor
Copy link
Author

aecorredor commented Jul 30, 2018

@cobarx so I had the domain by domain exception, but I did not have the Allow Arbitrary Loads enabled. I enabled it but still did not see the tracks coming back. I don't quite get when you say that I may have the video domain enabled but not the track domain. They both come from the HLS video file, or am I missing something else?

@cobarx
Copy link
Contributor

cobarx commented Jul 30, 2018

The way HLS works is it acts as a playlist that combines all the various assets needed for the stream. For a given stream, there can be multiple video, audio, and text tracks, all of which can come from different servers. In the case of your playlist, there are multiple sub-playlists for different video resolutions:

#EXTM3U
#EXT-X-VERSION:4
#EXT-X-STREAM-INF:BANDWIDTH=7293450,RESOLUTION=1920x1080
chunklist_b7293450.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=5601658,RESOLUTION=1920x1080
chunklist_b5601658.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3557452,RESOLUTION=1280x720
chunklist_b3557452.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2743097,RESOLUTION=1280x720
chunklist_b2743097.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2267168,RESOLUTION=960x540
chunklist_b2267168.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1810023,RESOLUTION=768x432
chunklist_b1810023.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1354626,RESOLUTION=512x288
chunklist_b1354626.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=996658,RESOLUTION=384x216
chunklist_b996658.m3u8

However, they are all coming from the same server. So I doubt there is an issue with the wrong domain being enabled.

I'm not sure what to tell you at the moment, since it's working fine for me. You'll need to check the console logs and set breakpoints in the native code to see if there is any kind of diagnostic info which can help out with this. I would also see if you can test this with an https server just to be extra sure. Your server has SSL, however the certificate isn't valid so I doubt it will work.

@aecorredor
Copy link
Author

@cobarx ok man awesome, thanks for the help. I will debug, test, and come back to let you know what happened.

@aecorredor
Copy link
Author

aecorredor commented Jul 31, 2018

@cobarx hey can you please confirm which version you were able to test and see my playlist working on? Was it in 3.0.0 or in 3.1.0? Also, is there a chance to see your info.plist? I've been debugging with my co-worker but we've had no luck so far. For other external videos that we are testing (like http://sample.vodobox.com/planete_interdite/planete_interdite_alternate.m3u8) we do get the tracks correctly on iOS. We've tried changing the info.plist, debugging to see what data comes out from the onLoad, etc. Thanks again.

@aecorredor
Copy link
Author

aecorredor commented Jul 31, 2018

@cobarx noticed you merged a new PR and closed this issue. Do you think any of those changes might help fix the issue I'm encountering? Thanks.

@cobarx
Copy link
Contributor

cobarx commented Jul 31, 2018

Oops this issue got closed automatically when the PR was merged.

That was just some minor code cleanups. It won't fix the issue you're running into. I'll test your video with 3.0.0 and 3.1.0 later this afternoon.

@aecorredor
Copy link
Author

@cobarx awesome, you're the man!

@cobarx
Copy link
Contributor

cobarx commented Aug 1, 2018

@aecorredor I tested with 3.0.0, 3.1.0 and the latest master and it's appearing on all of them. If you're not seeing the textTracks in onLoad, that means they're failing to load. Other people have been running into similar issues and I'm not sure what's at fault. It seems like AVPlayer is finicky about http sources even with security turned off. Are you able to setup https on this server and see if that fixes it? I'd be curious to know if that resolves these issues.

The relevant part of my Info.plist looks like:

	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
	</dict>

@cobarx cobarx reopened this Aug 1, 2018
@aecorredor
Copy link
Author

aecorredor commented Aug 1, 2018

@cobarx ok got it. I'm going to try to get that https server set up to test that. Either way, I'm still wondering why when we tested with http://sample.vodobox.com/planete_interdite/planete_interdite_alternate.m3u8 which is also http, it did work on iOS ok. That would make me doubt that it's the http/https security causing the issue right?

Anyway, I'll try to get the server set up and see what happens. Thanks again!

@alensaqe
Copy link

alensaqe commented Nov 2, 2020

I am facing the exact same issue with AudioTracks on iOS did you manage to find out what it was @aecorredor ?

@hueniverse hueniverse added the stale Closed due to inactivity or lack or resources label Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Closed due to inactivity or lack or resources
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants