TheWidlarzGroup / react-native-video

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

[BUG]: app crashed on ios when try to change video resource after it return from background #3900

Open eslamvet opened 2 weeks ago

eslamvet commented 2 weeks ago

Version

6.2.0

What platforms are you having the problem on?

iOS

System Version

Mac os senoma 14.3

On what device are you experiencing the issue?

Real device, Simulator

Architecture

Old architecture

What happened?

this is the error message that appear in xcode Cannot remove an observer <NSKeyValueObservance 0x600000d07330> for the key path \"currentItem.videoComposition\" from <AVPlayer 0x6000000a64e0>, most likely because the value for the key \"currentItem\" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the AVPlayer class.

Reproduction

No response

Reproduction

the video player has play in background flag is playing video and went on background and then i open app and try to change video source so the app crash while doing that

freeboub commented 2 weeks ago

I tried to reproduce the issue with the sample app, I cannot reproduce it. Can you please give more details on how to reproduce the issue ? (or maybe a sample app)

eslamvet commented 2 weeks ago

hi @freeboub just use Video Component with controls prop to true and playInBackground prop to false and leave app in background the video will still playing in background then open app again and try to change video source the app will crash in ios

eslamvet commented 2 weeks ago

you can use this repo to reproduce the issue https://github.com/ammar20305/Dummy steps: run app on ios simulator then go to background then open app again and click on button to change video source the app crash