From b18c34eb78d2683ea96d02bedf87257ff29aecc1 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Fri, 18 Jun 2021 18:50:41 +0530 Subject: [PATCH] Fix for videos with no dash streams. This works by loading the best premuxed stream. --- src/components/Player.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 21a30075..ee8af30c 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -44,13 +44,15 @@ export default { if (this.video.livestream) { uri = this.video.hls; - } else { + } else if (this.video.audioStreams.length > 0) { 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); + } else { + uri = this.video.videoStreams[0].url; } if (noPrevPlayer) @@ -132,7 +134,7 @@ export default { ) this.player.configure("manifest.disableVideo", true); - player.load(uri).then(() => { + player.load(uri, 0, uri.indexOf("dash+xml") >= 0 ? "application/dash+xml" : "video/mp4").then(() => { this.video.subtitles.map(subtitle => { player.addTextTrackAsync( subtitle.url,