mirror of https://github.com/FreeTubeApp/FreeTube
Better idle mouse hiding implementation (#3214)
This commit is contained in:
parent
8a3ca07c06
commit
5d9383b67b
|
@ -6,6 +6,10 @@
|
|||
width:100%;
|
||||
}
|
||||
|
||||
.ftVideoPlayer.vjs-user-inactive {
|
||||
cursor: none;
|
||||
}
|
||||
|
||||
:deep(.sponsorBlockMarker), :deep(.chapterMarker) {
|
||||
position: absolute;
|
||||
opacity: 0.6;
|
||||
|
|
|
@ -28,7 +28,6 @@ export default defineComponent({
|
|||
if (this.player !== null && !this.player.isInPictureInPicture()) {
|
||||
this.player.dispose()
|
||||
this.player = null
|
||||
clearTimeout(this.mouseTimeout)
|
||||
} else if (this.player.isInPictureInPicture()) {
|
||||
this.player.play()
|
||||
}
|
||||
|
@ -102,8 +101,6 @@ export default defineComponent({
|
|||
maxFramerate: 0,
|
||||
activeSourceList: [],
|
||||
activeAdaptiveFormats: [],
|
||||
mouseTimeout: null,
|
||||
touchTimeout: null,
|
||||
playerStats: null,
|
||||
statsModal: null,
|
||||
showStatsModal: false,
|
||||
|
@ -341,7 +338,6 @@ export default defineComponent({
|
|||
if (!this.player.isInPictureInPicture()) {
|
||||
this.player.dispose()
|
||||
this.player = null
|
||||
clearTimeout(this.mouseTimeout)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -468,9 +464,6 @@ export default defineComponent({
|
|||
document.removeEventListener('keydown', this.keyboardShortcutHandler)
|
||||
document.addEventListener('keydown', this.keyboardShortcutHandler)
|
||||
|
||||
this.player.on('mousemove', this.hideMouseTimeout)
|
||||
this.player.on('mouseleave', this.removeMouseTimeout)
|
||||
|
||||
this.player.on('volumechange', this.updateVolume)
|
||||
if (this.videoVolumeMouseScroll) {
|
||||
this.player.on('wheel', this.mouseScrollVolume)
|
||||
|
@ -1694,22 +1687,6 @@ export default defineComponent({
|
|||
}
|
||||
},
|
||||
|
||||
hideMouseTimeout: function () {
|
||||
if (typeof this.$refs.video !== 'undefined') {
|
||||
this.$refs.video.style.cursor = 'default'
|
||||
clearTimeout(this.mouseTimeout)
|
||||
this.mouseTimeout = setTimeout(() => {
|
||||
this.$refs.video.style.cursor = 'none'
|
||||
}, 2650)
|
||||
}
|
||||
},
|
||||
|
||||
removeMouseTimeout: function () {
|
||||
if (this.mouseTimeout !== null) {
|
||||
clearTimeout(this.mouseTimeout)
|
||||
}
|
||||
},
|
||||
|
||||
fullscreenOverlay: function () {
|
||||
const title = document.title.replace('- FreeTube', '')
|
||||
|
||||
|
|
Loading…
Reference in New Issue