Fix for videos with no dash streams.

This works by loading the best premuxed stream.
This commit is contained in:
FireMasterK 2021-06-18 18:50:41 +05:30
parent c9065b3ac5
commit b18c34eb78
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -44,13 +44,15 @@ export default {
if (this.video.livestream) { if (this.video.livestream) {
uri = this.video.hls; uri = this.video.hls;
} else { } else if (this.video.audioStreams.length > 0) {
const dash = require("@/utils/DashUtils.js").default.generate_dash_file_from_formats( const dash = require("@/utils/DashUtils.js").default.generate_dash_file_from_formats(
streams, streams,
this.video.duration, 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.videoStreams[0].url;
} }
if (noPrevPlayer) if (noPrevPlayer)
@ -132,7 +134,7 @@ export default {
) )
this.player.configure("manifest.disableVideo", true); 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 => { this.video.subtitles.map(subtitle => {
player.addTextTrackAsync( player.addTextTrackAsync(
subtitle.url, subtitle.url,