Solving quick bugs with the web player.

This commit is contained in:
Zoe Roux 2019-09-25 23:13:56 +02:00
parent 604c68721b
commit d99c3f0e08
2 changed files with 22 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { MatSnackBar } from "@angular/material/snack-bar";
import { DomSanitizer, Title } from "@angular/platform-browser";
import { ActivatedRoute, Router } from "@angular/router";
import { Event, ActivatedRoute, Router, NavigationStart } from "@angular/router";
import { Track, WatchItem } from "../../models/watch-item";
declare var SubtitleManager: any;
@ -194,12 +194,12 @@ export class PlayerComponent implements OnInit
if (document.fullscreenElement != null)
{
this.fullscreenIcon = "fullscreen_exit";
$("#fullscreen").attr("data-original-title", "Exit fullscreen").tooltip("show");
$("#fullscreen").attr("data-original-title", "Exit fullscreen");
}
else
{
this.fullscreenIcon = "fullscreen";
$("#fullscreen").attr("data-original-title", "Fullscreen").tooltip("show");
$("#fullscreen").attr("data-original-title", "Fullscreen");
}
});
@ -249,7 +249,7 @@ export class PlayerComponent implements OnInit
case 80: //P key
if (this.item.previousEpisode != null)
this.router.navigate(["/watch/" + this.item.previousEpisode], { queryParamsHandling: "merge" });
this.router.navigate(["/watch/" + this.item.previousEpisode], { queryParamsHandling: "merge" });
break;
default:
@ -257,6 +257,20 @@ export class PlayerComponent implements OnInit
}
});
this.router.events.subscribe((event: Event) =>
{
switch (true)
{
case event instanceof NavigationStart:
{
loadIndicator.classList.remove("d-none");
break;
}
default:
break;
}
});
$('[data-toggle="tooltip"]').tooltip({ trigger: "hover" });
this.init();
@ -306,12 +320,14 @@ export class PlayerComponent implements OnInit
ngOnDestroy()
{
if (document.fullscreen)
document.exitFullscreen();
document.getElementById("nav").classList.remove("d-none");
this.title.setTitle("Kyoo");
$(document).unbind();
$(window).unbind();
document.exitFullscreen();
$('[data-toggle="tooltip"]').hide();
}

View File

@ -1,6 +1,6 @@
{
"databasePath": "C://Projects/database.db",
"tempPath": "C:\\Projects",
"tempPath": "C://Projects/temp",
"peoplePath": "D://Videos/People",
"plugins": "C:\\Projects\\Kyoo\\Debug",
"providerPlugins": "C://Projects/Plugins/Providers",