Audio: onPlaybackStatusUpdate not called while buffering

The docs state:

onPlaybackStatusUpdate will be called whenever a call to the API for this playbackObject completes (such as setStatusAsync() , getStatusAsync() , or unloadAsync() ), and will also be called at regular intervals while the media is in the loaded state.

However, I’m observing that, after the initial status update when isLoaded is true, I don’t get any status updates during the buffering stage. The first one I see is when playback actually starts. This means that I can’t display any progress indicator for buffering, even though that information is available as part of the status (playableDurationMillis) once it starts updating. Is this the expected behavior, or am I missing something?

I’m also curious why this isn’t called during loading, as that seems like useful progress to be able to display as well.

Hey @brettdh,

Can you share the relevant code here that shows your implementation? Also, what SDK version are you using?

Cheers,
Adam

@adamjnav sure thing. Here’s the code that runs Audio.Sound.createAsync with an onPlaybackStatusUpdate callback: https://github.com/theliturgists/app/blob/master/src/state/ducks/playback/epic.js#L20

I see the callback fire (that is, I see an object emitted from the Observable) once when isBuffering is true, but not again until it’s false. After that point, when isPlaying is true, I see it every 500ms as I expected based on the default settings.

@adamjnav Any further thoughts on this? I’ve also verified via console.log that the callback is not actually being called until isPlaying is true, so it’s nothing to do with the details of how I’m using redux-observable or anything like that.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.