TheWidlarzGroup / react-native-video

A <Video /> component for react-native
MIT License
7.08k stars 2.85k forks source link

preferredForwardBufferDuration not working. It doesn't change anything #2698

Open NicolasMarzullo opened 2 years ago

NicolasMarzullo commented 2 years ago

Bug

Platform

Which player are you experiencing the problem on:

Environment info

React native info output:

info Fetching system and libraries information...
System:
    OS: macOS 12.3.1
    CPU: (8) arm64 Apple M1
    Memory: 112.56 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.2.0 - /opt/homebrew/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.3.0 - /opt/homebrew/bin/npm
    Watchman: 2021.12.13.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/nicolasmarzullo/.rvm/gems/ruby-3.0.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7935034
    Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
  Languages:
    Java: 15.0.2 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.4 => 0.66.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 5.2.0

Steps To Reproduce

  1. Use react-native-video with a heavy video (>400MB)
  2. set prop preferredForwardBufferDuration={15}
  3. Test if the video plays smoothly without interruptions ...

Expected behaviour

  1. Player waits for buffer before continue playing.

Reproducible sample code

<Video
                    style={{
                        flex: 1,
                        backgroundColor: 'black'
                    }}
                    source={{ uri: mediaUri }}
                    ref={playerRef}
                    resizeMode="contain"
                    playInBackground
                    playWhenInactive
                    onLoad={( e ) => {
                        onLoadVideo( e );
                    }}
                    useTextureView={false}
                    ignoreSilentSwitch="ignore"
                    onBuffer={onBufferPlayer}
                    onEnd={onEndPlayer}
                    onProgress={onProgress}
                    poster={poster}
                    audioOnly={audioOnly}
                    paused={playerPaused}
                    onError={onLoadingVideoError}
                    fullscreen={Platform.select( {
                        ios: false,
                        android: fullScreen
                    } )}
                    bufferConfig={bufferConfig}
                    preferredForwardBufferDuration={15}
                    automaticallyWaitsToMinimizeStalling={false}
                />
freeboub commented 2 years ago

I just have a look into code, I didn't see any 'problem'; @NicolasMarzullo code looks simple around this feature. Can you double the paramter is well applied in your case please ?

NicolasMarzullo commented 2 years ago

Hi @freeboub, thanks for your answer. I was checking this issue in a fork version of this repository so i tried to test this issue again cloning this repository but i couldn't build the example component. I ran yarn xbasic install and Xcode threw this error:

Image Pasted at 2022-6-8 11-17

talal-tilted commented 4 months ago

Hello @NicolasMarzullo did you find a solution, i have the same problem