[Android] fix video player hud timeout on TV
Sébastien Toque
git at videolan.org
Wed Dec 15 13:35:11 UTC 2021
vlc-android | branch: master | Sébastien Toque <xilasz at gmail.com> | Wed Dec 15 13:31:57 2021 +0100| [d3f643e05f19ffad032d4f14a215c9176f6d5889] | committer: Sébastien Toque
fix video player hud timeout on TV
> https://code.videolan.org/videolan/vlc-android/commit/d3f643e05f19ffad032d4f14a215c9176f6d5889
---
.../src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt | 14 +++++++-------
.../videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt | 6 +++---
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 407b001d8..281e6d1a8 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -939,7 +939,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
return false
}
if (isShowing || fov == 0f && keyCode == KeyEvent.KEYCODE_DPAD_DOWN && !overlayDelegate.playlistContainer.isVisible())
- overlayDelegate.showOverlayTimeout(Settings.videoHudDelay)
+ overlayDelegate.showOverlayTimeout(Settings.videoHudDelay * 1000)
when (keyCode) {
KeyEvent.KEYCODE_MEDIA_FAST_FORWARD -> {
touchDelegate.seekDelta(Settings.videoDoubleTapJumpDelay * 1000)
@@ -989,7 +989,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
if (isNavMenu)
return navigateDvdMenu(keyCode)
else if (isLocked) {
- overlayDelegate.showOverlayTimeout(Settings.videoHudDelay)
+ overlayDelegate.showOverlayTimeout(Settings.videoHudDelay * 1000)
} else if (!isShowing && !overlayDelegate.playlistContainer.isVisible()) {
if (event.isAltPressed && event.isCtrlPressed) {
touchDelegate.seekDelta(-300000)
@@ -1010,7 +1010,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
if (isNavMenu)
return navigateDvdMenu(keyCode)
else if (isLocked) {
- overlayDelegate.showOverlayTimeout(Settings.videoHudDelay)
+ overlayDelegate.showOverlayTimeout(Settings.videoHudDelay * 1000)
} else if (!isShowing && !overlayDelegate.playlistContainer.isVisible()) {
if (event.isAltPressed && event.isCtrlPressed) {
touchDelegate.seekDelta(300000)
@@ -1031,7 +1031,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
if (isNavMenu)
return navigateDvdMenu(keyCode)
else if (isLocked) {
- overlayDelegate.showOverlayTimeout(Settings.videoHudDelay)
+ overlayDelegate.showOverlayTimeout(Settings.videoHudDelay * 1000)
} else if (event.isCtrlPressed) {
volumeUp()
return true
@@ -1047,7 +1047,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
if (isNavMenu)
return navigateDvdMenu(keyCode)
else if (isLocked) {
- overlayDelegate.showOverlayTimeout(Settings.videoHudDelay)
+ overlayDelegate.showOverlayTimeout(Settings.videoHudDelay * 1000)
} else if (event.isCtrlPressed) {
volumeDown()
return true
@@ -1060,7 +1060,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
if (isNavMenu)
return navigateDvdMenu(keyCode)
else if (isLocked) {
- overlayDelegate.showOverlayTimeout(Settings.videoHudDelay)
+ overlayDelegate.showOverlayTimeout(Settings.videoHudDelay * 1000)
} else if (!isShowing) {
doPlayPause()
return true
@@ -1396,7 +1396,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
overlayDelegate.updateOverlayPausePlay()
updateNavStatus()
if (!mw.hasFlag(MediaWrapper.MEDIA_PAUSED))
- handler.sendEmptyMessageDelayed(FADE_OUT, Settings.videoHudDelay.toLong())
+ handler.sendEmptyMessageDelayed(FADE_OUT, Settings.videoHudDelay.toLong() * 1000)
else {
mw.removeFlags(MediaWrapper.MEDIA_PAUSED)
wasPaused = false
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
index 764e1baad..209a5da09 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
@@ -391,7 +391,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
hudBinding.abRepeatMarkerA.visibility = if (abvalues.start == -1L) View.GONE else View.VISIBLE
hudBinding.abRepeatMarkerB.visibility = if (abvalues.stop == -1L) View.GONE else View.VISIBLE
service.manageAbRepeatStep(hudBinding.abRepeatReset, hudBinding.abRepeatStop, hudBinding.abRepeatContainer, abRepeatAddMarker)
- if (player.settings.getBoolean(VIDEO_TRANSITION_SHOW, true)) showOverlayTimeout(if (abvalues.start == -1L || abvalues.stop == -1L) VideoPlayerActivity.OVERLAY_INFINITE else Settings.videoHudDelay)
+ if (player.settings.getBoolean(VIDEO_TRANSITION_SHOW, true)) showOverlayTimeout(if (abvalues.start == -1L || abvalues.stop == -1L) VideoPlayerActivity.OVERLAY_INFINITE else Settings.videoHudDelay * 1000)
})
service.playlistManager.abRepeatOn.observe(player, {
abRepeatAddMarker.visibility = if (it) View.VISIBLE else View.GONE
@@ -472,7 +472,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
hudBinding.orientationToggle.setOnClickListener(if (enabled) player else null)
hudBinding.orientationToggle.setOnLongClickListener(if (enabled) player else null)
hudBinding.swipeToUnlock.setOnStartTouchingListener { showOverlayTimeout(VideoPlayerActivity.OVERLAY_INFINITE) }
- hudBinding.swipeToUnlock.setOnStopTouchingListener { showOverlayTimeout(Settings.videoHudDelay) }
+ hudBinding.swipeToUnlock.setOnStopTouchingListener { showOverlayTimeout(Settings.videoHudDelay * 1000) }
hudBinding.swipeToUnlock.setOnUnlockListener { player.toggleLock() }
}
if (::hudRightBinding.isInitialized){
@@ -808,7 +808,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
bookmarkListDelegate.markerContainer = hudBinding.bookmarkMarkerContainer
bookmarkListDelegate.visibilityListener = {
if (bookmarkListDelegate.visible) showOverlayTimeout(VideoPlayerActivity.OVERLAY_INFINITE)
- else showOverlayTimeout(Settings.videoHudDelay)
+ else showOverlayTimeout(Settings.videoHudDelay * 1000)
}
}
bookmarkListDelegate.show()
More information about the Android
mailing list