Skip to content

Commit

Permalink
fix(player): reset player when error ERROR_CODE_BEHIND_LIVE_WINDOW
Browse files Browse the repository at this point in the history
…happens
  • Loading branch information
ThibaultBee committed Oct 5, 2023
1 parent 1d1fdd9 commit a5e5afe
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ internal constructor(
eventTime: AnalyticsListener.EventTime,
error: PlaybackException
) {
if (error.errorCode == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW) {
// Re-initialize player at the current live window default position.
exoplayer.seekToDefaultPosition()
exoplayer.prepare()
}
listeners.forEach { listener -> listener.onError(error) }
}

Expand Down

0 comments on commit a5e5afe

Please sign in to comment.