Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS player stops playing after a few minutes #240

Open
Aung-Myint-Thein opened this issue Aug 22, 2020 · 6 comments
Open

iOS player stops playing after a few minutes #240

Aung-Myint-Thein opened this issue Aug 22, 2020 · 6 comments

Comments

@Aung-Myint-Thein
Copy link

This library is working fine to play local files for a few minutes. My set up is that I added the player on multi pages and the pages keep switching because of user navigation. Each screen might play a different sound file. However, it stops playing after a few minutes and it is not giving any error on play() and prepare(). Have anyone of you faced this problem before?

Thanks

@Aung-Myint-Thein
Copy link
Author

I am using on Hook component thou.

@Aung-Myint-Thein
Copy link
Author

After it stops, I managed to get the console out for player and they are as following:

{"_duration": -1, "_lastSync": -1, "_looping": false, "_options": {"autoDestroy": true, "category": 1, "continuesToPlayInBackground": false, "mixWithOthers": true}, "_pan": 0, "_path": "file:////var/mobile/Containers/Data/Application/D2CCFAA0-2596-49E2-A3C0-D73BCB5B67F3/Library/Caches/voice/0205traeg.mp3", "_playerId": 21, "_position": -1, "_speed": 1, "_state": 0, "_volume": 1, "_wakeLock": false}

Anything unusual? Thanks!

@Aung-Myint-Thein
Copy link
Author

After investigation, prepare() function won't return anything after this happens and prepare() will just fail silently. Hence, play() won't play any sound. Any clue or suggestion?

@Aung-Myint-Thein
Copy link
Author

After a few more testing, I realized the player stops playing a few seconds after I receive a notification from other apps. hope this gets more clue. My player set up is as following:

_player.current = new Player(`file:///${RNFetchBlob.fs.dirs.CacheDir}/voice/1.mp3}`, {
      autoDestroy: true,
      continuesToPlayInBackground: false,
      category: "Ambient",
      mixWithOthers: true,
    });

@btuck044
Copy link

I am also having a similar issue with the prepare on ios stop working as well

@alkathakur2016
Copy link

I am also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants