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

Player state does not always change to playing #88

Open
biesbjerg opened this issue Nov 2, 2019 · 0 comments
Open

Player state does not always change to playing #88

biesbjerg opened this issue Nov 2, 2019 · 0 comments

Comments

@biesbjerg
Copy link

Player state sometimes does not change to playing, even though audio starts and elapsedSecond event emits. It happens randomly, but more often if your network connection is slow. I'm testing on a device using Network Link Conditioner in Settings -> Developer Options to simulate a slow connection.

image

If you look at this log, it shouldn't be possible for player.playerState to be paused while emitting secondElapse (and actually playing):

⌛ stateChange - state: paused
⌛ stateChange - state: loading
⌛ stateChange - state: paused
⌛ secondElapse - currentTime: 0.0 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ secondElapse - currentTime: 0.0 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ secondElapse - currentTime: 0.0 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 0.3657142857142857
⌛ secondElapse - currentTime: 0.02672804 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ secondElapse - currentTime: 0.026939374 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 2.36472281
⌛ updateDuration: 7.380233014
⌛ secondElapse - currentTime: 1.000674124 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 11.403090157
⌛ updateDuration: 16.941049341
⌛ secondElapse - currentTime: 2.000570967 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 20.467579953
⌛ secondElapse - currentTime: 3.001347996 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 23.994110565
⌛ updateDuration: 27.520641177
⌛ secondElapse - currentTime: 4.001117254 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 33.032477912
⌛ updateDuration: 36.559008524
⌛ secondElapse - currentTime: 5.001199992 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 42.096967708
⌛ secondElapse - currentTime: 6.000966879 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 46.616151381
⌛ updateDuration: 52.154110565
⌛ secondElapse - currentTime: 7.000541125 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 55.680641177
⌛ secondElapse - currentTime: 7.856695665 / state: Optional(SwiftAudio.AVPlayerWrapperState.paused)
⌛ updateDuration: 59.20717179

Tested on a device with iOS 13.

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