aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/shared/video/video-details.model.ts4
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts10
2 files changed, 13 insertions, 1 deletions
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts
index 8463e15d7..22f024656 100644
--- a/client/src/app/shared/video/video-details.model.ts
+++ b/client/src/app/shared/video/video-details.model.ts
@@ -52,4 +52,8 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
52 getHlsPlaylist () { 52 getHlsPlaylist () {
53 return this.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS) 53 return this.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS)
54 } 54 }
55
56 hasHlsPlaylist () {
57 return !!this.getHlsPlaylist()
58 }
55} 59}
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 {
423 } 423 }
424 } 424 }
425 425
426 const mode: PlayerMode = urlOptions.playerMode === 'p2p-media-loader' ? 'p2p-media-loader' : 'webtorrent' 426 let mode: PlayerMode
427
428 if (urlOptions.playerMode) {
429 if (urlOptions.playerMode === 'p2p-media-loader') mode = 'p2p-media-loader'
430 else mode = 'webtorrent'
431 } else {
432 if (this.video.hasHlsPlaylist()) mode = 'p2p-media-loader'
433 else mode = 'webtorrent'
434 }
427 435
428 if (mode === 'p2p-media-loader') { 436 if (mode === 'p2p-media-loader') {
429 const hlsPlaylist = this.video.getHlsPlaylist() 437 const hlsPlaylist = this.video.getHlsPlaylist()