expo-av. Audio is break. Help me

Please provide the following:

  1. SDK Version:
    “expo”: “36.0.0”,
  2. Platforms(Android/iOS/web/all):
    Android

I have to play audio for 50 minutes
Set “expo-av”: “6.0.0”

I wrote the code as in the examples.
In the module did initialization at boot

componentDidMount() {
Audio.setAudioModeAsync({
allowsRecordingIOS: false,
staysActiveInBackground: true,
interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,
playsInSilentModeIOS: true,
shouldDuckAndroid: true,
interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX,
playThroughEarpieceAndroid: false
});
this._loadNewPlaybackInstance(true);
}

And next play a audio:

async _loadNewPlaybackInstance(playing) {
const source = { uri: ‘mp3/music1.mp3’ };
const initialStatus = {
shouldPlay: playing,
rate: this.state.rate,
shouldCorrectPitch: this.state.shouldCorrectPitch,
volume: this.state.volume,
isMuted: this.state.muted,
isLooping: false
// // UNCOMMENT THIS TO TEST THE OLD androidImplementation:
// androidImplementation: ‘MediaPlayer’,
};
const {sound, status} = await Audio.Sound.createAsync(
source,
initialStatus,
this._onPlaybackStatusUpdate
);

When testing a project in Expo, everything works fine, audio plays, in a locked phone as well.

But when I publish the application in G.play, the problems begin.
On a locked phone, music plays for 10-15 minutes and stops. Moreover, the play player command is ignored. To enable playback again, you need to create an Audio object again. And then everything plays again 10-15 minutes.
The application published both in apk and app-bundle, everywhere the situation is the same.

What to do?

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