From 631c50ba3336e2d4e8613520462b6d8c83454075 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 16 Aug 2021 01:24:34 +0530 Subject: [PATCH] Use pre-existing dash manifest wherever possible. Useful for videos where only OTF streams are available. --- src/components/Player.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 61d4bb43..1b7772cc 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -94,12 +94,14 @@ export default { if (this.video.livestream) { uri = this.video.hls; } else if (this.video.audioStreams.length > 0 && !lbry && MseSupport) { - const dash = require("@/utils/DashUtils.js").default.generate_dash_file_from_formats( - streams, - this.video.duration, - ); + if (!this.video.dash) { + const dash = require("@/utils/DashUtils.js").default.generate_dash_file_from_formats( + streams, + this.video.duration, + ); - uri = "data:application/dash+xml;charset=utf-8;base64," + btoa(dash); + uri = "data:application/dash+xml;charset=utf-8;base64," + btoa(dash); + } else uri = this.video.dash; } else if (lbry) { uri = lbry.url; } else { @@ -211,7 +213,7 @@ export default { quality > 0 && (this.video.audioStreams.length > 0 || this.video.livestream) && !disableVideo; if (qualityConds) this.player.configure("abr.enabled", false); - player.load(uri, 0, uri.indexOf("dash+xml") >= 0 ? "application/dash+xml" : "video/mp4").then(() => { + player.load(uri, 0, uri.indexOf("dash") >= 0 ? "application/dash+xml" : "video/mp4").then(() => { if (qualityConds) { var leastDiff = Number.MAX_VALUE; var bestStream = null;