mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Use pre-existing dash manifest wherever possible.
Useful for videos where only OTF streams are available.
This commit is contained in:
parent
e07ac8016a
commit
631c50ba33
1 changed files with 8 additions and 6 deletions
|
@ -94,12 +94,14 @@ export default {
|
||||||
if (this.video.livestream) {
|
if (this.video.livestream) {
|
||||||
uri = this.video.hls;
|
uri = this.video.hls;
|
||||||
} else if (this.video.audioStreams.length > 0 && !lbry && MseSupport) {
|
} else if (this.video.audioStreams.length > 0 && !lbry && MseSupport) {
|
||||||
|
if (!this.video.dash) {
|
||||||
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.dash;
|
||||||
} else if (lbry) {
|
} else if (lbry) {
|
||||||
uri = lbry.url;
|
uri = lbry.url;
|
||||||
} else {
|
} else {
|
||||||
|
@ -211,7 +213,7 @@ export default {
|
||||||
quality > 0 && (this.video.audioStreams.length > 0 || this.video.livestream) && !disableVideo;
|
quality > 0 && (this.video.audioStreams.length > 0 || this.video.livestream) && !disableVideo;
|
||||||
if (qualityConds) this.player.configure("abr.enabled", false);
|
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) {
|
if (qualityConds) {
|
||||||
var leastDiff = Number.MAX_VALUE;
|
var leastDiff = Number.MAX_VALUE;
|
||||||
var bestStream = null;
|
var bestStream = null;
|
||||||
|
|
Loading…
Reference in a new issue