fix(rn,audio) fix playback after API change

Upstream now skips the callback, so we need to provide one.
This commit is contained in:
Saúl Ibarra Corretgé 2022-01-06 16:53:13 +01:00 committed by Saúl Ibarra Corretgé
parent 29eb9452c0
commit 90f836040f
1 changed files with 7 additions and 1 deletions

View File

@ -69,7 +69,13 @@ export default class Audio extends AbstractAudio {
play() {
if (this._sound) {
this._sound.setNumberOfLoops(this.props.loop ? -1 : 0);
super.play();
// $FlowExpectedError
this._sound.play(success => {
if (!success) {
logger.warn(`Failed to play ${this.props.src}`);
}
});
}
}