mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 07:20:33 -04:00
Using built-in hls player if it exists
This commit is contained in:
parent
129eb4b9ba
commit
c037f0dc72
@ -346,11 +346,12 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
|||||||
selectPlayMethod(playMethod: method)
|
selectPlayMethod(playMethod: method)
|
||||||
{
|
{
|
||||||
this.playMethod = playMethod;
|
this.playMethod = playMethod;
|
||||||
if (this.playMethod == method.direct)
|
const url: string = `/video/${this.playMethod.toLowerCase()}/${this.item.slug}/`;
|
||||||
this.player.src = `/video/${this.item.slug}`;
|
if (this.playMethod == method.direct || this.player.canPlayType("application/vnd.apple.mpegurl"))
|
||||||
|
this.player.src = url;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.hlsPlayer.loadSource(`/video/${this.playMethod.toLowerCase()}/${this.item.slug}/`);
|
this.hlsPlayer.loadSource(url);
|
||||||
this.hlsPlayer.attachMedia(this.player);
|
this.hlsPlayer.attachMedia(this.player);
|
||||||
this.hlsPlayer.on(Hls.Events.MANIFEST_LOADED, () =>
|
this.hlsPlayer.on(Hls.Events.MANIFEST_LOADED, () =>
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user