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] Play after pause always resets to start of current track #9

Open
dasantonym opened this issue Jun 20, 2021 · 1 comment
Open

Comments

@dasantonym
Copy link

dasantonym commented Jun 20, 2021

Not sure if I am doing something fundamentally wrong here, but when I create a single-track playlist like this:

const player = new RmxAudioPlayer()
await player.initialize()
await player.setOptions({
  verbose: false,
  options: {
    icon: 'icon_bw'
  }
})
await player.addItem({
  title: 'asdf',
  assetUrl: uri,
  isStream: false,
  trackId: uuidv4()
})
await player.play()

This plays just fine, but pause seems to behave oddly.

When I call await player.pause() on the player, it pauses, but after calling await player.play() it always starts from the beginning of the track.

Seeking also has no effect and I am not getting any errors so I assume this is some fundamental problem here? The lock-screen controls cause the same reset after pause and then play. I tried it using the setPlaylistItems command and used the retainPosition: true option, but to no avail.

Edit: This is happening on iOS 13.1.2

@dasantonym
Copy link
Author

Just saw that it behaves normally once I comment out this:

if isAtEnd {
// we could add a flag here to indicate looping
setCurrentIndex(0)
}

phiamo added a commit that referenced this issue Mar 27, 2022
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

1 participant