[Video] set audio category to ambient every time a new player is made (#4934)
* set auto category to ambient every time a new player is made * mute on foregrounding * remember previous state --------- Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com> Co-authored-by: Hailey <me@haileyok.com>
This commit is contained in:
parent
26d3777ecc
commit
21e214c235
4 changed files with 22 additions and 2 deletions
|
|
@ -28,6 +28,9 @@ export function VideoEmbedInnerNative() {
|
|||
useEffect(() => {
|
||||
try {
|
||||
if (isAppFocused === 'active' && isScreenFocused && !player.playing) {
|
||||
PlatformInfo.setAudioCategory(AudioCategory.Ambient)
|
||||
PlatformInfo.setAudioActive(false)
|
||||
player.muted = true
|
||||
player.play()
|
||||
} else if (player.playing) {
|
||||
player.pause()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue