From d77ab806e58fdcd1f4b22cb5b1d51eb5af677e67 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 8 Jul 2021 01:04:46 +0530 Subject: [PATCH] Add limited support for devices without MSE extensions. (#251) --- 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 2f007236..e39f2bd5 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -55,11 +55,13 @@ export default { streams.push(...this.video.audioStreams); streams.push(...this.video.videoStreams); + const MseSupport = window.MediaSource !== undefined; + var uri; if (this.video.livestream) { uri = this.video.hls; - } else if (this.video.audioStreams.length > 0) { + } else if (this.video.audioStreams.length > 0 && MseSupport) { const dash = require("@/utils/DashUtils.js").default.generate_dash_file_from_formats( streams, this.video.duration, @@ -67,7 +69,7 @@ export default { uri = "data:application/dash+xml;charset=utf-8;base64," + btoa(dash); } else { - uri = this.video.videoStreams[0].url; + uri = this.video.videoStreams.filter(stream => stream.codec == null)[0].url; } if (noPrevPlayer)