From d99c3f0e086d816cd384c11aa36d0086e9fed443 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 25 Sep 2019 23:13:56 +0200 Subject: [PATCH] Solving quick bugs with the web player. --- .../src/app/player/player.component.ts | 26 +++++++++++++++---- Kyoo/config.json | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Kyoo/ClientApp/src/app/player/player.component.ts b/Kyoo/ClientApp/src/app/player/player.component.ts index 08122f09..2a58ee0f 100644 --- a/Kyoo/ClientApp/src/app/player/player.component.ts +++ b/Kyoo/ClientApp/src/app/player/player.component.ts @@ -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(); } diff --git a/Kyoo/config.json b/Kyoo/config.json index 0d31b949..fda33350 100644 --- a/Kyoo/config.json +++ b/Kyoo/config.json @@ -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",