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

[BUG]: IOS- keeps buffering #3675

Open
rohankm opened this issue Apr 11, 2024 · 23 comments
Open

[BUG]: IOS- keeps buffering #3675

rohankm opened this issue Apr 11, 2024 · 23 comments
Labels
bug demo requested Please submit a simple app that shows the issue

Comments

@rohankm
Copy link

rohankm commented Apr 11, 2024

Version

v6 (Beta)

What platforms are you having the problem on?

iOS

Architecture

Old architecture

What happened?

After seeking the hls video in ios is just stuck buffering and never plays back.

Reproduction

repository link

Reproduction

Step to reproduce this bug are:

@rohankm rohankm added the bug label Apr 11, 2024
@freeboub
Copy link
Collaborator

Any way to reproduce? Are you able to reproduce with the sample included in the repo ?

@freeboub freeboub added the demo requested Please submit a simple app that shows the issue label Apr 12, 2024
@rohankm
Copy link
Author

rohankm commented Apr 12, 2024

Any way to reproduce? Are you able to reproduce with the sample included in the repo ?

Hi, I'm working with Fairplay DRM.. I'm not quite sure how to send a reproducible example

@rohankm rohankm changed the title [BUG]: IOS- keeps buffering on seek [BUG]: IOS- keeps buffering Apr 12, 2024
@rohankm
Copy link
Author

rohankm commented Apr 13, 2024

video with lesser duration plays fine but not with more duration(30 mins +). The player is stuck buffering

@rohankm
Copy link
Author

rohankm commented May 1, 2024

the issue still persists in the latest version

@rohankm
Copy link
Author

rohankm commented May 15, 2024

@freeboub the issue still exists for the DRM videos on ios... videos without DRM work fine.

@freeboub
Copy link
Collaborator

Not sure how we can help here ...
Do you have issues in xcode logs ? Did you try to record a charles trace to ensure network communications work fine ?

@rohankm
Copy link
Author

rohankm commented May 15, 2024

@freeboub the network communication is fine and there are no xcode logs.. it's just the video buffers forever. {"isBuffering": true, "target": 6819}

Im currently testing with ios 14.8

@rohankm
Copy link
Author

rohankm commented May 16, 2024

@freeboub I tested on a newer device with the latest ios but the problem still exists... probably can we connect on discord and I will share the DRM content so that you can check it from your end also.

@rohankm
Copy link
Author

rohankm commented May 16, 2024

adding maxBitRate={3000000} the video loads perfectly

@KrzysztofMoch
Copy link
Collaborator

So probably not an library issue ?

@rohankm
Copy link
Author

rohankm commented May 17, 2024

So probably not an library issue ?

I really don't understand what exactly is the issue.. or how do I even debug the issue

@KrzysztofMoch
Copy link
Collaborator

Maybe I will add to docs (in debug section) to try set maxBitRate in such case - let's close this as I see that this worked for you

@rohankm
Copy link
Author

rohankm commented May 18, 2024

setting maxBitRate={0} also works fine

@rohankm rohankm closed this as completed May 18, 2024
@rohankm
Copy link
Author

rohankm commented May 20, 2024

@freeboub @KrzysztofMoch reopening the issue as setting maxBitRate just lowers the video quality. Also, i tested with expo-video and it works fine... I don't know what the issue is with react-native-video with DRM videos. Is there any steps to debug this buffering issue?

@rohankm rohankm reopened this May 20, 2024
@Meet-Kapadiya
Copy link

Same problem still persists in 6.2.0, You can check by logging "isBuffering", It never returns false

@Meet-Kapadiya
Copy link

 useEffect(() => {
    if (Platform.OS === 'ios' && loading) {
      setTimeout(() => {
        setLoading(false);
      }, 2500);
    }
  }, [loading]);

For temporary workaround you can do this

@rohankm
Copy link
Author

rohankm commented May 24, 2024

We cannot use this hack in production... The bug should be fixed

@freeboub
Copy link
Collaborator

If you want to investigate here are some inputs:
handlePlaybackBufferKeyEmpty and handlePlaybackLikelyToKeepUp are good starting points.
relevant documentation is here: https://developer.apple.com/documentation/avfoundation/avplayeritem/1390348-isplaybacklikelytokeepup

@Meet-Kapadiya
Copy link

react-native-video+6.1.2.patch

I made the patch, it works fine, but at the beginning when I start playing the video, the buffering takes time to return false is proportional to the length of the video.

@rohankm
Copy link
Author

rohankm commented May 24, 2024

@Meet-Kapadiya are you testing with drm videos or normal?

@Meet-Kapadiya
Copy link

HLS streams

@Meet-Kapadiya
Copy link

react-native-video+6.1.2.patch

I made the patch, it works fine, but at the beginning when I start playing the video, the buffering takes time to return false is proportional to the length of the video.

To solve this you can set

  • preferredForwardBufferDuration={15} (In Seconds)
  • Default value is 0, So player will choose an appropriate level of buffering

@maksymhcode-care
Copy link

It seems that it only happens with HLS/m3u8 format, please take a look at that @freeboub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug demo requested Please submit a simple app that shows the issue
Projects
None yet
Development

No branches or pull requests

5 participants