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) {
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,