From bf651da5e796b464258e57ae8224f47ad1094c4e Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 20 Jan 2021 21:21:14 +0530 Subject: [PATCH] player: Add quality selector for livestreams. --- src/components/WatchVideo.vue | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index bf46134d..1e1dc678 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -199,19 +199,14 @@ export default { // label: "DASH" // }); - if (this.video.livestream) { + this.video.videoStreams.map(stream => src.push({ - src: this.video.hls, - type: "application/x-mpegURL" - }); - } else { - this.video.videoStreams.map(stream => - src.push({ - src: stream.url, - type: stream.mimeType, - label: stream.quality - }) - ); + src: stream.url, + type: stream.mimeType, + label: stream.quality, + videoOnly: stream.videoOnly + }) + ); this.video.audioStreams.map(stream => src.push({ @@ -220,7 +215,7 @@ export default { label: stream.quality }) ); - } + if (!this.audioplayer) this.audioplayer = new Audio(