mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-08-07 09:01:29 -04:00
Cleaning up
This commit is contained in:
parent
76fbdce3be
commit
b9b5039e82
@ -1,11 +1,11 @@
|
|||||||
import {Component, Inject, Injector, OnInit, ViewEncapsulation} from '@angular/core';
|
import {Component, Injector, 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, Event, NavigationCancel, NavigationEnd, NavigationStart, Router} from "@angular/router";
|
import {ActivatedRoute, Event, NavigationCancel, NavigationEnd, NavigationStart, Router} from "@angular/router";
|
||||||
import {Track, WatchItem} from "../../models/watch-item";
|
import {Track, WatchItem} from "../../models/watch-item";
|
||||||
import {Location} from "@angular/common";
|
import {Location} from "@angular/common";
|
||||||
import * as Hls from "hls.js"
|
import * as Hls from "hls.js"
|
||||||
import { getPlaybackMethod, method, getWhatIsSupported, SupportList } from "../../videoSupport/playbackMethodDetector";
|
import {getPlaybackMethod, getWhatIsSupported, method, SupportList} from "../../videoSupport/playbackMethodDetector";
|
||||||
import {OidcSecurityService} from "angular-auth-oidc-client";
|
import {OidcSecurityService} from "angular-auth-oidc-client";
|
||||||
|
|
||||||
declare var SubtitleManager: any;
|
declare var SubtitleManager: any;
|
||||||
@ -105,13 +105,13 @@ export class PlayerComponent implements OnInit
|
|||||||
this.player.onplay = () =>
|
this.player.onplay = () =>
|
||||||
{
|
{
|
||||||
this.initPlayBtn();
|
this.initPlayBtn();
|
||||||
}
|
};
|
||||||
|
|
||||||
this.player.onpause = () =>
|
this.player.onpause = () =>
|
||||||
{
|
{
|
||||||
this.playIcon = "play_arrow"
|
this.playIcon = "play_arrow";
|
||||||
this.playTooltip = "Play";
|
this.playTooltip = "Play";
|
||||||
}
|
};
|
||||||
|
|
||||||
this.player.ontimeupdate = () =>
|
this.player.ontimeupdate = () =>
|
||||||
{
|
{
|
||||||
@ -132,17 +132,17 @@ export class PlayerComponent implements OnInit
|
|||||||
this.player.onwaiting = () =>
|
this.player.onwaiting = () =>
|
||||||
{
|
{
|
||||||
loadIndicator.classList.remove("d-none");
|
loadIndicator.classList.remove("d-none");
|
||||||
}
|
};
|
||||||
|
|
||||||
this.player.oncanplay = () =>
|
this.player.oncanplay = () =>
|
||||||
{
|
{
|
||||||
loadIndicator.classList.add("d-none");
|
loadIndicator.classList.add("d-none");
|
||||||
}
|
};
|
||||||
|
|
||||||
this.player.onended = () =>
|
this.player.onended = () =>
|
||||||
{
|
{
|
||||||
this.next();
|
this.next();
|
||||||
}
|
};
|
||||||
|
|
||||||
this.player.onerror = () =>
|
this.player.onerror = () =>
|
||||||
{
|
{
|
||||||
@ -158,7 +158,7 @@ export class PlayerComponent implements OnInit
|
|||||||
this.playMethod = method.transcode;
|
this.playMethod = method.transcode;
|
||||||
this.selectPlayMethod(this.playMethod);
|
this.selectPlayMethod(this.playMethod);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
let progressBar: HTMLElement = document.getElementById("progress-bar") as HTMLElement;
|
let progressBar: HTMLElement = document.getElementById("progress-bar") as HTMLElement;
|
||||||
$(progressBar).click((event) =>
|
$(progressBar).click((event) =>
|
||||||
@ -245,8 +245,7 @@ export class PlayerComponent implements OnInit
|
|||||||
this.seeking = false;
|
this.seeking = false;
|
||||||
progressBar.classList.remove("seeking");
|
progressBar.classList.remove("seeking");
|
||||||
|
|
||||||
let time: number = this.getTimeFromSeekbar(progressBar, event.changedTouches[0].pageX);
|
this.player.currentTime = this.getTimeFromSeekbar(progressBar, event.changedTouches[0].pageX);
|
||||||
this.player.currentTime = time;
|
|
||||||
this.player.play();
|
this.player.play();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user