mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Cleaning up the click handler
This commit is contained in:
parent
b592e43dc6
commit
2186280d85
@ -96,9 +96,7 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
|||||||
{
|
{
|
||||||
this.controlHider = setTimeout(() =>
|
this.controlHider = setTimeout(() =>
|
||||||
{
|
{
|
||||||
if (!this.player.paused && !this.areControlHovered)
|
this.showControls = this.player.paused || this.areControlHovered;
|
||||||
this.showControls = false;
|
|
||||||
// else restart timer
|
|
||||||
}, 2500);
|
}, 2500);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -334,28 +332,9 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
|||||||
|
|
||||||
videoClicked()
|
videoClicked()
|
||||||
{
|
{
|
||||||
if (!navigator.userAgent.match(/Mobi/))
|
this.showControls = !this.player.paused;
|
||||||
|
if (!AppComponent.isMobile)
|
||||||
this.togglePlayback();
|
this.togglePlayback();
|
||||||
else
|
|
||||||
{
|
|
||||||
if ($("#hover").hasClass("idle"))
|
|
||||||
{
|
|
||||||
$("#hover").removeClass("idle");
|
|
||||||
clearTimeout(this.controlHider);
|
|
||||||
this.controlHider = setTimeout((ev: MouseEvent) =>
|
|
||||||
{
|
|
||||||
if (!this.player.paused)
|
|
||||||
{
|
|
||||||
document.getElementById("hover").classList.add("idle");
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$("#hover").addClass("idle");
|
|
||||||
clearTimeout(this.controlHider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
togglePlayback()
|
togglePlayback()
|
||||||
@ -368,10 +347,10 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
|||||||
|
|
||||||
fullscreen()
|
fullscreen()
|
||||||
{
|
{
|
||||||
if (document.fullscreenElement == null)
|
if (this.isFullScreen)
|
||||||
document.body.requestFullscreen();
|
|
||||||
else
|
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
|
else
|
||||||
|
document.body.requestFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
getVolumeBtn(): string
|
getVolumeBtn(): string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user