Open nadav2051 opened 5 years ago
Could you post a stack trace?
Sure, I'll reproduce and post it, but I've also noticed that I can't find .resume() in the API representation at the index.d.ts, is it possible it has been deprecated?
I don't see a .resume()
function. I think you just use .play()
.
Yep, I've worked around by tracking current second while pausing, and seek to position before playing again.
just .play()ing will restart the audio.
Anyway, I'd say the API on the front page should be updated to remove the Resume functionality unless we've both missed something.
Yep, I've worked around by tracking current second while pausing, and seek to position before playing again.
just .play()ing will restart the audio.
Anyway, I'd say the API on the front page should be updated to remove the Resume functionality unless we've both missed something.
Hey @nadav2051 may I know what the workaround was?
@meghaptg Sure!
One you start playing, you set an interval that tracks the seconds played (soundObject.getCurrentTime), keep that data in the object level, and when a time when you want to resume comes, use soundObject.setCurrentTime to the time you have saved from the interval tracking the getCurrentTime, followed by soundObject.play().
Hope you found this helpful!
:beetle: Description
calling .resume() produces a 'resume is not a function' error.
:beetle: What is the observed behavior?
A Sound reference has been initialized, a play has been called on that reference, the music has started playing. Once a .resume() has been called on the same reference, RN threw an error of 'resume is not a function'. When switching .resume() to .play() at the exact same location, it's working properly, the only problem is it's playing the song from the beginning. however that negates the possibility I'm working on a null reference in that state.
:beetle: What is the expected behavior?
I expect the sound to resume at the same time I've called the .pause() function.
:beetle: Please post your code:
:bulb: Does the problem have a test case?
:bulb: **Possible solution**:bulb: Is there a workaround?
:bulb: If the bug is confirmed, would you be willing to create a pull request?
Is your issue with...
Are you using...
react-native run-android
)Which versions are you using?
Does the problem occur on...