[Video] Resume background audio whenever muting video audio (#4915)
This commit is contained in:
parent
c2131bb039
commit
65d6e561d4
6 changed files with 28 additions and 17 deletions
|
@ -159,7 +159,7 @@ function App() {
|
|||
|
||||
React.useEffect(() => {
|
||||
PlatformInfo.setAudioCategory(AudioCategory.Ambient)
|
||||
PlatformInfo.setAudioMixWithOthers(true)
|
||||
PlatformInfo.setAudioActive(true)
|
||||
initPersistedState().then(() => setReady(true))
|
||||
}, [])
|
||||
|
||||
|
|
|
@ -60,12 +60,12 @@ export function VideoEmbedInnerNative() {
|
|||
nativeControls={true}
|
||||
onEnterFullscreen={() => {
|
||||
PlatformInfo.setAudioCategory(AudioCategory.Playback)
|
||||
PlatformInfo.setAudioMixWithOthers(false)
|
||||
PlatformInfo.setAudioActive(false)
|
||||
player.muted = false
|
||||
}}
|
||||
onExitFullscreen={() => {
|
||||
PlatformInfo.setAudioCategory(AudioCategory.Ambient)
|
||||
PlatformInfo.setAudioMixWithOthers(true)
|
||||
PlatformInfo.setAudioActive(true)
|
||||
player.muted = true
|
||||
if (!player.playing) player.play()
|
||||
}}
|
||||
|
@ -139,7 +139,7 @@ function Controls({
|
|||
const category = muted ? AudioCategory.Ambient : AudioCategory.Playback
|
||||
|
||||
PlatformInfo.setAudioCategory(category)
|
||||
PlatformInfo.setAudioMixWithOthers(mix)
|
||||
PlatformInfo.setAudioActive(mix)
|
||||
player.muted = muted
|
||||
}, [player])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue