TheWidlarzGroup/react-native-video

preferredForwardBufferDuration not working. It doesn't change anything

Closed

#2,698 opened on May 26, 2022

 (3 comments) (1 reaction) (0 assignees)Kotlin (3,027 forks)batch import
6.x.xPlatform: iOSV6good first issuetriage needed

Repository metrics

Stars
 (7,677 stars)
PR merge metrics
 (Avg merge 2d 3h) (11 merged PRs in 30d)

Description

Bug

Platform

Which player are you experiencing the problem on:

  • iOS real device (iPhone 11).

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}
				/>

Contributor guide