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

View File

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