TheWidlarzGroup / react-native-video

A <Video /> component for react-native
http://thewidlarzgroup.github.io/react-native-video/
MIT License
7.14k stars 2.88k forks source link

Not able to play on iOS version 15 and below | AVFoundationErrorDomain #2976

Open rahulje9 opened 1 year ago

rahulje9 commented 1 year ago

Bug

I've created an audio player using the React-native-video package. it is working fine on iOS 16 and android devices. on iOS device with version 15 or below getting the following errors.

code: -11800
domain: "AVFoundationErrorDomain"
localizedDescription: "The operation could not be completed"
localizedFailureReason: "An unknown error occurred (-66681)"
localizedRecoverySuggestion: ""

Platform

Which player are you experiencing the problem on:

Environment info

React native info output:

System:
    OS: macOS 13.0
    CPU: (8) x64 Apple M1 Pro
    Memory: 6.69 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 8.6.0 - /opt/homebrew/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 14.0/14A309 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.3 => 0.69.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 5.2.0

Steps To Reproduce

Reproducible sample code

        <Video
          audioOnly={true}
          ref={vpRef}
          paused={paused}
          volume={volume}
          onLoadStart={_onLoadStart}
          onLoad={_onLoad}
          onProgress={_onProgress}
          onEnd={_onEnd}
          resizeMode={'contain'}
          source={{uri: source}} // Can be a URL or a local file.
          onError={_videoError} // Callback when video cannot be loaded
          onBuffer={_onBuffer}
        />

Video sample

dvijeniii05 commented 1 year ago

Got the same issue using video file. The same error message however on any iOS version but only on physical devices. Works fine on emualtors

stachu2k commented 1 year ago

Got this issue in Sentry from one of my users, url prop looks fine, mp4 file. I have no idea what causes this error.

pgpankajbigstep commented 1 year ago

Any update for this issue ? I am facing this issue still with real device with iOS version 15.6.

azuluaga-hu commented 1 year ago

I'm trying with ios 16 and work ok.

zyestin commented 1 year ago

try ignoreSilentSwitch={'ignore'}, likely to be effective

MinhThu100200 commented 8 months ago

same. any update??? I got this issue when I using video url both real device and emulator

valeriavodianchuk commented 2 months ago

Still reproducible, ios 15.7.9, local video, real device

abanobmikaeel commented 2 months ago

Seeing similar issues on latest. An example url I tried was really any MP4 even,

{"error": {"code": -11850, "domain": "AVFoundationErrorDomain", "localizedDescription": "Operation Stopped", "localizedFailureReason": "The server is not correctly configured.", "localizedRecoverySuggestion": ""}, "target": 713}

Charles traffic yields the same error basically. Running on iOS 17.5, iPhone 15 Pro Max,

  <Video
    source={{
      uri: 'https://www3.cde.ca.gov/download/rod/big_buck_bunny.mp4',
      type: 'mp4',
    }}
    resizeMode={ResizeMode.COVER}
    fullscreenOrientation="landscape"
    style={styles.video}
    paused={!isPlaying}
    controls={showControls}
    repeat={true}
    onLoadStart={onLoadStart}
    onError={(error) => {
      console.log(error, 'video playback error');
    }}
    onReadyForDisplay={onLoadEnd}
  />
"react-native-video": "6.3.0",
"react-native-video-controls": "^2.8.1",
"expo": "^49.0.16",
"react-native": "0.72.6",

Will try downgrading and reporting back if that helped.

abanobmikaeel commented 2 months ago

Weirdly enough it randomly started working again ... no idea why :D

ElizavetaZhigunova commented 14 hours ago

Tell me, has someone solved this problem? I can't run the video from either a real device or a simulator