Audio plays on iOS but not on Android

  1. SDK Version: 37
  2. Platform: Android

I am playing a video in my Expo / React Native app.

The video works perfectly on both iOS and Android.

However, the audio does not play on Android. The video’s audio works perfectly on iOS.

Here is my video functional component:

import React, { useEffect, useRef } from 'react'; 
import { Video, Audio } from 'expo-av';   

export default function SingleVideo(props) {

    useEffect(() => {
        Audio.setAudioModeAsync({
            playsInSilentModeIOS: true
        }); 
    }, [])

    return (
        <Video
            source={{uri: props.source}}
            rate={1.0}
            volume={1.0}
            isMuted={false}
            resizeMode="cover"
            usePoster={true}
            shouldPlay={props.shouldPlay}
            progressUpdateIntervalMillis={50}
            isLooping
            style={{ width: '100%', height: '100%'}}
        >
        </Video>
    )
}

It looks like it’s a streaming problem. When I change the source from a streaming link to a standard mp4 link (i.e. ‘http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4’), it works.

Does streaming on Android not work on Expo?

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