mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
CS3Player: fixed ERROR_CODE_BEHIND_LIVE_WINDOW (#447)
This commit is contained in:
parent
4ed65f8e07
commit
4f9016713f
1 changed files with 13 additions and 6 deletions
|
@ -985,12 +985,19 @@ class CS3IPlayer : IPlayer {
|
|||
// If the Network fails then ignore the exception if the duration is set.
|
||||
// This is to switch mirrors automatically if the stream has not been fetched, but
|
||||
// allow playing the buffer without internet as then the duration is fetched.
|
||||
if (error.errorCode == PlaybackException.ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
|
||||
&& exoPlayer?.duration != TIME_UNSET
|
||||
) {
|
||||
exoPlayer?.prepare()
|
||||
} else {
|
||||
playerError?.invoke(error)
|
||||
when {
|
||||
error.errorCode == PlaybackException.ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
|
||||
&& exoPlayer?.duration != TIME_UNSET -> {
|
||||
exoPlayer?.prepare()
|
||||
}
|
||||
error.errorCode == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW -> {
|
||||
// Re-initialize player at the current live window default position.
|
||||
exoPlayer?.seekToDefaultPosition()
|
||||
exoPlayer?.prepare()
|
||||
}
|
||||
else -> {
|
||||
playerError?.invoke(error)
|
||||
}
|
||||
}
|
||||
|
||||
super.onPlayerError(error)
|
||||
|
|
Loading…
Reference in a new issue