Open bmitioglov opened 1 year ago
Downgraded to this version: "react-native-video": "^5.2.1", and now it works as expected, background music is playing until I hit play in the video. So looks like there is something wrong with the newer version (6.0.0-alpha.6).
also, UI freeze is not there with the older version (when I was opening the view with the video it kind of waited until my video stream was loaded)
I just try to reproduce this issue with react native video version. It seems to be fixed (we had some merged PR recently around this audio management feature). I will close the issue, let me know if I need to reopen. notice that I added in the sample:
ignoreSilentSwitch="ignore"
disableFocus={true}
pictureInPicture={true}
Tested on emulator (which doesn't support pip, maybe that is the issue)
@freeboub I'm using v6.4.5
and I can reproduce the issue in iOS in my current project.
Using only ignoreSilentSwitch="obey"
will keep the background music playing - but that doesn't make sense to me. I would assume that muted={false}
should be enough to prevent background music from pausing.
@ctriantaf I think you should also enable https://thewidlarzgroup.github.io/react-native-video/component/props#playwheninactive and https://thewidlarzgroup.github.io/react-native-video/component/props#playinbackground
@freeboub I tried enable both playWhenInactive
and playInBackground
and changing ignoreSilentSwitch="ignore"
but the background music stops when the video is mounted. I'll stick to ignoreSilentSwitch="obey"
for now as it seems to work.
This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.
Was it fixed in the new version?
Bug
Background music stops when ignoreSilentSwitch="ignore"
Platform
Which player are you experiencing the problem on:
Environment info
"^6.0.0-alpha.6" Device: iPhone 12 Pro, iOS: 16.5.1
Steps To Reproduce
1. Configure a video like this
2. Start music in the background (Spotify for example), run the app, and open the view with this video component -> Spotify music stops.
3. It works correctly when I set ignoreSilentSwitch to obey, but I need to ignore the silent switch and at the same time not block other sounds. ...
Expected behaviour
Reproducible sample code