switch back to 1x speed on live stream end

This commit is contained in:
Bnyro 2022-07-30 13:20:11 +02:00
parent 5271a279f3
commit 11b568d0b6

View File

@ -957,7 +957,8 @@ class PlayerFragment : Fragment() {
binding.apply { binding.apply {
playerViewsInfo.text = playerViewsInfo.text =
context?.getString(R.string.views, response.views.formatShort()) + context?.getString(R.string.views, response.views.formatShort()) +
"" + response.uploadDate if (!isLive) "" + response.uploadDate else ""
textLike.text = response.likes.formatShort() textLike.text = response.likes.formatShort()
textDislike.text = response.dislikes.formatShort() textDislike.text = response.dislikes.formatShort()
ConnectionHelper.loadImage(response.uploaderAvatar, binding.playerChannelImage) ConnectionHelper.loadImage(response.uploaderAvatar, binding.playerChannelImage)
@ -1018,8 +1019,13 @@ class PlayerFragment : Fragment() {
!playWhenReady !playWhenReady
) )
// switch back to normal speed when on the end of live stream
if (isLive && (exoPlayer.duration - exoPlayer.duration < 0.5)) {
exoPlayer.setPlaybackSpeed(1F)
playerBinding.speedText.text = "1x"
}
// check if video has ended, next video is available and autoplay is enabled. // check if video has ended, next video is available and autoplay is enabled.
if ( else if (
playbackState == Player.STATE_ENDED && playbackState == Player.STATE_ENDED &&
nextStreamId != null && nextStreamId != null &&
!transitioning && !transitioning &&