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

HLS stream UI block when loading a broken URL (iOS) #1067

Closed
HeinzStaschen opened this issue Jun 14, 2018 · 8 comments
Closed

HLS stream UI block when loading a broken URL (iOS) #1067

HeinzStaschen opened this issue Jun 14, 2018 · 8 comments
Labels
stale Closed due to inactivity or lack or resources

Comments

@HeinzStaschen
Copy link

Current behavior

Screen doesn't render until the onError callback gets triggered.

Reproduction steps

Set the Video component source uri to a broken https m3u8 URL.

Expected behavior

Screen needs to render normally so I can display a loader and then handle the onError event if needed.

Platform

  • iOS

Video sample

https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8

I've investigated RCTVideo.m and noticed you guys use AVURLAsset (which I suspect might be the cause of the issue):

if (isNetwork) {
    NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
    AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:@{AVURLAssetHTTPCookiesKey : cookies}];
    return [AVPlayerItem playerItemWithAsset:asset];
  }

Refer to link for possible solution:
https://stackoverflow.com/questions/38777384/avurlasset-urlassetwithurloptions-blocks-main-thread-with-remote-url

@danielmcmillan
Copy link

Do you still get this issue if you don't specify any one of the props 'ignoreSilentSwitch', 'rate', 'volume' or 'muted'?
If not than my pull request #1086 may fix the issue. Potentially the cause is what you have referenced and this just happens to work around it though.

@namgk
Copy link

namgk commented Jun 28, 2018

I have the same problem, but I have 'volume' prop on. Will try to remove it.

@treemore
Copy link

treemore commented Jul 1, 2018

use charles. start throttling . the ios ui will block util buffed success

@cobarx
Copy link
Contributor

cobarx commented Aug 6, 2018

Are people still having this issue?

I tested the PR in #1113 and it has the side effect of causing the video to show up if you start the video paused. I think the solution @HeinzStaschen proposed is the right way to handle this, but it will take a fair bit of work to implement that. So lmk if that rework is needed.

@StuartMorris0
Copy link

This issue still exists for me on iOS.

I only have props for source, onError, style and controls. The video locks up the main UI thread when loading the video, once the video is loaded it is released.

@BaderSerhan
Copy link
Contributor

@StuartMorris0 are you starting the videos paused?

@StuartMorris0
Copy link

I think they autoplay but I cannot remember 100%.

@muganwas
Copy link

I'm using version 5.0.2 and I'm still experiencing this issue. Is there a solution?

@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

No branches or pull requests

9 participants