diff options
Diffstat (limited to 'dist/plyr.polyfilled.js')
-rw-r--r-- | dist/plyr.polyfilled.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/dist/plyr.polyfilled.js b/dist/plyr.polyfilled.js index 2a515ff6..260e4ac4 100644 --- a/dist/plyr.polyfilled.js +++ b/dist/plyr.polyfilled.js @@ -7318,6 +7318,16 @@ typeof navigator === "object" && (function (global, factory) { return; } + // If duration is the 2**32 (shaka), Infinity (HLS), DASH-IF (Number.MAX_SAFE_INTEGER || Number.MAX_VALUE) indicating live we hide the currentTime and progressbar. + // https://github.com/video-dev/hls.js/blob/5820d29d3c4c8a46e8b75f1e3afa3e68c1a9a2db/src/controller/buffer-controller.js#L415 + // https://github.com/google/shaka-player/blob/4d889054631f4e1cf0fbd80ddd2b71887c02e232/lib/media/streaming_engine.js#L1062 + // https://github.com/Dash-Industry-Forum/dash.js/blob/69859f51b969645b234666800d4cb596d89c602d/src/dash/models/DashManifestModel.js#L338 + if (this.duration >= Math.pow(2, 32)) { + toggleHidden(this.elements.display.currentTime, true); + toggleHidden(this.elements.progress, true); + return; + } + // Update ARIA values if (is$1.element(this.elements.inputs.seek)) { this.elements.inputs.seek.setAttribute('aria-valuemax', this.duration); @@ -12161,7 +12171,7 @@ typeof navigator === "object" && (function (global, factory) { var params = { AV_PUBLISHERID: '58c25bb0073ef448b1087ad6', AV_CHANNELID: '5a0458dc28a06145e4519d21', - AV_URL: location.hostname, + AV_URL: window.location.hostname, cb: Date.now(), AV_WIDTH: 640, AV_HEIGHT: 480, @@ -13093,8 +13103,9 @@ typeof navigator === "object" && (function (global, factory) { // Faux duration set via config var fauxDuration = parseFloat(this.config.duration); - // Media duration can be NaN before the media has loaded - var duration = (this.media || {}).duration || 0; + // Media duration can be NaN or Infinity before the media has loaded + var realDuration = (this.media || {}).duration; + var duration = !is$1.number(realDuration) || realDuration === Infinity ? 0 : realDuration; // If config duration is funky, use regular duration return fauxDuration || duration; |