diff --git a/assets/js/plugins/NativeAudioPlayer.staticjs b/assets/js/plugins/NativeAudioPlayer.staticjs index 2ebdfa375..cc1ef0c1f 100644 --- a/assets/js/plugins/NativeAudioPlayer.staticjs +++ b/assets/js/plugins/NativeAudioPlayer.staticjs @@ -42,6 +42,15 @@ class NativeAudioPlayer { // Report playback status changes to web _reportStatus(status) { + // Playback has finished and should be reported as stopped + if (status.isFinished) { + if (this._isPlaying) { + this._isPlaying = false; + this._safelyTriggerEvent('stopped'); + } + return; + } + // The item uri has changed if (status.uri !== this.uri) { this.uri = status.uri; @@ -65,15 +74,6 @@ class NativeAudioPlayer { return; } - // Playback has finished and should be reported as stopped - if (status.isFinished) { - if (this._isPlaying) { - this._isPlaying = false; - this._safelyTriggerEvent('stopped'); - } - return; - } - // The playing state has changed if (status.isPlaying !== this._isPlaying) { this._isPlaying = status.isPlaying;