mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Changing hls path
This commit is contained in:
parent
c037f0dc72
commit
19ae493109
@ -3,7 +3,7 @@ import { Track, WatchItem } from "../../models/watch-item";
|
|||||||
|
|
||||||
export enum method
|
export enum method
|
||||||
{
|
{
|
||||||
direct = "Direct Play",
|
direct = "Direct",
|
||||||
transmux = "Transmux",
|
transmux = "Transmux",
|
||||||
transcode = "Transcode"
|
transcode = "Transcode"
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,7 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
|||||||
|
|
||||||
playbackError(): void
|
playbackError(): void
|
||||||
{
|
{
|
||||||
if (this.playMethod == method.transcode)
|
if (this.playMethod === method.transcode)
|
||||||
{
|
{
|
||||||
this.snackBar.open("This episode can't be played.", null, {
|
this.snackBar.open("This episode can't be played.", null, {
|
||||||
horizontalPosition: "left",
|
horizontalPosition: "left",
|
||||||
@ -335,7 +335,7 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (this.playMethod == method.direct)
|
if (this.playMethod === method.direct)
|
||||||
this.playMethod = method.transmux;
|
this.playMethod = method.transmux;
|
||||||
else
|
else
|
||||||
this.playMethod = method.transcode;
|
this.playMethod = method.transcode;
|
||||||
@ -346,8 +346,13 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
|||||||
selectPlayMethod(playMethod: method)
|
selectPlayMethod(playMethod: method)
|
||||||
{
|
{
|
||||||
this.playMethod = playMethod;
|
this.playMethod = playMethod;
|
||||||
const url: string = `/video/${this.playMethod.toLowerCase()}/${this.item.slug}/`;
|
const url: string = [
|
||||||
if (this.playMethod == method.direct || this.player.canPlayType("application/vnd.apple.mpegurl"))
|
"/video",
|
||||||
|
this.playMethod.toLowerCase(),
|
||||||
|
this.item.slug,
|
||||||
|
this.playMethod != method.direct ? 'master.m3u8' : null
|
||||||
|
].filter(x => x !== null).join("/");
|
||||||
|
if (this.playMethod === method.direct || this.player.canPlayType("application/vnd.apple.mpegurl"))
|
||||||
this.player.src = url;
|
this.player.src = url;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user