From 656591660527e8ba48d496c8d6b34598f869ea05 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 14 May 2019 11:35:54 +0200 Subject: Use HLS by default if enabled --- client/src/app/videos/+video-watch/video-watch.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'client/src/app/videos/+video-watch') diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 0532e7de7..b147b75b0 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -423,7 +423,15 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } } - const mode: PlayerMode = urlOptions.playerMode === 'p2p-media-loader' ? 'p2p-media-loader' : 'webtorrent' + let mode: PlayerMode + + if (urlOptions.playerMode) { + if (urlOptions.playerMode === 'p2p-media-loader') mode = 'p2p-media-loader' + else mode = 'webtorrent' + } else { + if (this.video.hasHlsPlaylist()) mode = 'p2p-media-loader' + else mode = 'webtorrent' + } if (mode === 'p2p-media-loader') { const hlsPlaylist = this.video.getHlsPlaylist() -- cgit v1.2.3