AV/Sound volume up/down controls call instead media

  1. SDK Version: 39
  2. Platforms(Android/iOS/web/all): Android

I have built a media player with the help of expo-av library. When media is playing, if I hit the volume up/down controls of device (both on real device and emulator), it only affect in-call setting, I want only controlling the media volume. Here the configuration of playback object below;

useEffect(() => {
        const loadAudioAv = async () => {
            await Audio.setAudioModeAsync({
                allowsRecordingIOS: false,
                interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,
                playsInSilentModeIOS: true,
                interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX,
                shouldDuckAndroid: true,
                staysActiveInBackground: true,
                playThroughEarpieceAndroid: true
            })
        }
        loadAudioAv();
    }, []);


How can I configure this for desired behaviour?

Ok, I got it. The playThroughEarpieceAndroid: true configuration causes this. I removed that line, it is set to false though.

Glad you got things sorted out! Thanks for sharing your solution with the community as well.

Cheers,
Adam

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.