Closed gshotwell closed 7 years ago
Ah, it looks like this is an Apple TOS issue. I don't know how to fix this. https://github.com/ocetnik/react-native-background-timer/issues/9
I think this might be doable if I keep a silent sound running throughout the whole timer, so two tracks playing, one of which is a silent sound which repeats and has a volume of zero, the other is the actual session track.
Works! It seems like if I do a console log when the video loads it plays properly. I have no idea why this works but I'll take it.
Doesn't work! Looks like I need to refactor to have everything on RN Sound as they are enabling loading sounds from the network
Boy this is a tough issue. The big issue is that we need to preload each block file, but at the same time we need to make sure that we don't have a hundred sounds loaded up. So we need some process to load sounds a fe blocks ahead of time, so that there aren't any gaps when they play.
Here is my current plan:
state.firstSound
on componentWillMount()
this.state.loadedSounds
this.state.playingSound()
loadedSounds
array which matches the next block in the playerArray into this.state.playingSound
. At the same time load the i + 4
th sound and push it to this.state.loadedSounds
. We also need to release the sound which was previously playing. this.state.playingSound
isn't loaded the player pauses itself, spins, then unpauses itself when the block loads. firstSound
loaded in state, and when the timer is reset move it back to this.state.playingSound
and then redo the rest.
When you lock the device it will play the end of the current gong or contemplation, but not advance to the next block