mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 15:30:34 -04:00
Starting to add mobile support to the web app.
This commit is contained in:
parent
71efaa0832
commit
a07d2c123c
@ -1,6 +1,6 @@
|
|||||||
<div id="root">
|
<div id="root">
|
||||||
<div class="player">
|
<div class="player">
|
||||||
<video id="player" poster="backdrop/{{this.item.showSlug}}" autoplay muted (click)="tooglePlayback()" class="video-js">
|
<video id="player" poster="backdrop/{{this.item.showSlug}}" autoplay muted (click)="videoClicked()" class="video-js">
|
||||||
<source src="/video/{{this.item.link}}" />
|
<source src="/video/{{this.item.link}}" />
|
||||||
<source src="/video/transmux/{{this.item.link}}" type="video/mp4" />
|
<source src="/video/transmux/{{this.item.link}}" type="video/mp4" />
|
||||||
</video>
|
</video>
|
||||||
|
@ -62,6 +62,12 @@ export class PlayerComponent implements OnInit
|
|||||||
|
|
||||||
this.title.setTitle(this.item.showTitle + " S" + this.item.seasonNumber + ":E" + this.item.episodeNumber + " - Kyoo");
|
this.title.setTitle(this.item.showTitle + " S" + this.item.seasonNumber + ":E" + this.item.episodeNumber + " - Kyoo");
|
||||||
|
|
||||||
|
if (navigator.userAgent.match(/Mobi/))
|
||||||
|
{
|
||||||
|
this.fullscreen();
|
||||||
|
screen.orientation.lock("landscape");
|
||||||
|
$("#fullscreen").addClass("d-none");
|
||||||
|
}
|
||||||
if (this.player)
|
if (this.player)
|
||||||
this.init();
|
this.init();
|
||||||
});
|
});
|
||||||
@ -154,6 +160,8 @@ export class PlayerComponent implements OnInit
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!navigator.userAgent.match(/Mobi/))
|
||||||
|
{
|
||||||
$(document).mousemove((event) =>
|
$(document).mousemove((event) =>
|
||||||
{
|
{
|
||||||
if (this.seeking)
|
if (this.seeking)
|
||||||
@ -181,6 +189,7 @@ export class PlayerComponent implements OnInit
|
|||||||
|
|
||||||
$("#controller").mouseenter(() => { this.controllerHovered = true; });
|
$("#controller").mouseenter(() => { this.controllerHovered = true; });
|
||||||
$("#controller").mouseleave(() => { this.controllerHovered = false; });
|
$("#controller").mouseleave(() => { this.controllerHovered = false; });
|
||||||
|
}
|
||||||
|
|
||||||
//Initialize the timout at the document initialization.
|
//Initialize the timout at the document initialization.
|
||||||
this.videoHider = setTimeout(() =>
|
this.videoHider = setTimeout(() =>
|
||||||
@ -337,6 +346,32 @@ export class PlayerComponent implements OnInit
|
|||||||
$(window).unbind();
|
$(window).unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
videoClicked()
|
||||||
|
{
|
||||||
|
if (!navigator.userAgent.match(/Mobi/))
|
||||||
|
this.tooglePlayback();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($("#hover").hasClass("idle"))
|
||||||
|
{
|
||||||
|
$("#hover").removeClass("idle");
|
||||||
|
clearTimeout(this.videoHider);
|
||||||
|
this.videoHider = setTimeout((ev: MouseEvent) =>
|
||||||
|
{
|
||||||
|
if (!this.player.paused)
|
||||||
|
{
|
||||||
|
document.getElementById("hover").classList.add("idle");
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#hover").addClass("idle");
|
||||||
|
clearTimeout(this.videoHider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tooglePlayback()
|
tooglePlayback()
|
||||||
{
|
{
|
||||||
if (this.player.paused)
|
if (this.player.paused)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user