mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Merge pull request #5817 from FineFindus/fix/end-screen-controller
feat: improve video end screen
This commit is contained in:
commit
aca61c49d3
@ -41,6 +41,7 @@ import com.github.libretube.enums.PlayerEvent
|
|||||||
import com.github.libretube.enums.SbSkipOptions
|
import com.github.libretube.enums.SbSkipOptions
|
||||||
import com.github.libretube.extensions.updateParameters
|
import com.github.libretube.extensions.updateParameters
|
||||||
import com.github.libretube.obj.VideoStats
|
import com.github.libretube.obj.VideoStats
|
||||||
|
import com.github.libretube.util.PlayingQueue
|
||||||
import com.github.libretube.util.TextUtils
|
import com.github.libretube.util.TextUtils
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
@ -343,6 +344,11 @@ object PlayerHelper {
|
|||||||
)
|
)
|
||||||
|
|
||||||
fun shouldPlayNextVideo(isPlaylist: Boolean = false): Boolean {
|
fun shouldPlayNextVideo(isPlaylist: Boolean = false): Boolean {
|
||||||
|
// if there is no next video, it obviously should not be played
|
||||||
|
if (!PlayingQueue.hasNext()) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return autoPlayEnabled || (
|
return autoPlayEnabled || (
|
||||||
isPlaylist && PreferenceHelper.getBoolean(
|
isPlaylist && PreferenceHelper.getBoolean(
|
||||||
PreferenceKeys.AUTOPLAY_PLAYLISTS,
|
PreferenceKeys.AUTOPLAY_PLAYLISTS,
|
||||||
|
@ -113,11 +113,11 @@ import com.github.libretube.util.PlayingQueue
|
|||||||
import com.github.libretube.util.TextUtils
|
import com.github.libretube.util.TextUtils
|
||||||
import com.github.libretube.util.TextUtils.toTimeInSeconds
|
import com.github.libretube.util.TextUtils.toTimeInSeconds
|
||||||
import com.github.libretube.util.YoutubeHlsPlaylistParser
|
import com.github.libretube.util.YoutubeHlsPlaylistParser
|
||||||
import java.util.concurrent.Executors
|
|
||||||
import kotlin.math.abs
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
import java.util.concurrent.Executors
|
||||||
|
import kotlin.math.abs
|
||||||
|
|
||||||
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
|
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
|
||||||
class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
||||||
@ -313,7 +313,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
playNextVideo()
|
playNextVideo()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
binding.player.showController()
|
binding.player.showControllerPermanently()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,6 +269,12 @@ open class CustomExoPlayerView(
|
|||||||
super.showController()
|
super.showController()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun showControllerPermanently() {
|
||||||
|
// remove the previous callback from the queue to prevent a flashing behavior
|
||||||
|
cancelHideControllerTask()
|
||||||
|
super.showController()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onTouchEvent(event: MotionEvent) = false
|
override fun onTouchEvent(event: MotionEvent) = false
|
||||||
|
|
||||||
private fun initRewindAndForward() {
|
private fun initRewindAndForward() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user