Resolving a bug with the player in the mobile version.

This commit is contained in:
Zoe Roux 2019-10-27 19:22:17 +01:00
parent 492329149f
commit 000b5a7799
3 changed files with 12 additions and 8 deletions

View File

@ -63,7 +63,7 @@ export class PlayerComponent implements OnInit
this.title.setTitle(this.item.showTitle + " S" + this.item.seasonNumber + ":E" + this.item.episodeNumber + " - Kyoo");
if (navigator.userAgent.match(/Mobi/))
if (navigator.userAgent.match(/Mobi/) && document.fullscreenElement == null)
{
this.fullscreen();
screen.orientation.lock("landscape");
@ -81,9 +81,6 @@ export class PlayerComponent implements OnInit
this.progress = document.getElementById("progress") as HTMLElement;
this.buffered = document.getElementById("buffered") as HTMLElement;
this.player.controls = false;
//console.log(this.player.volume * 100);
//this.volume = this.player.volume * 100;
//this.changeVolumeBtn();
this.player.onplay = () =>
{
@ -206,7 +203,7 @@ export class PlayerComponent implements OnInit
{
if (navigator.userAgent.match(/Mobi/))
{
if (document.fullscreenElement == null)
if (document.fullscreenElement == null && this.router.url.startsWith("/watch"))
this.back();
}
else

View File

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute } from "@angular/router";
import { SearchResut } from "../../models/search-result";
import { Title } from "@angular/platform-browser";
@ -8,7 +8,7 @@ import { Title } from "@angular/platform-browser";
templateUrl: './search.component.html',
styleUrls: ['./search.component.scss']
})
export class SearchComponent implements OnInit
export class SearchComponent implements OnInit, OnDestroy
{
items: SearchResut;
@ -29,4 +29,11 @@ export class SearchComponent implements OnInit
searchBar.classList.add("searching");
searchBar.value = this.items.query;
}
ngOnDestroy()
{
let searchBar: HTMLInputElement = <HTMLInputElement>document.getElementById("search");
searchBar.classList.remove("searching");
searchBar.value = "";
}
}

View File

@ -10,7 +10,7 @@ import { Show } from "../../models/show";
@Injectable()
export class LibraryResolverService implements Resolve<Show[]>
{
constructor(private http: HttpClient, private snackBar: MatSnackBar) { console.log("Library Resolver Created"); }
constructor(private http: HttpClient, private snackBar: MatSnackBar) { }
resolve(route: ActivatedRouteSnapshot): Show[] | Observable<Show[]> | Promise<Show[]>
{