aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-02 13:45:32 +0100
committerChocobozzz <me@florianbigard.com>2021-12-03 10:14:17 +0100
commit22f25c740bf3eb24d9988ab6add8e1a6aec1b0bd (patch)
tree2f73f5dd5e66f841bcd617100f5d85f0c604b977
parent51e9e152f7df003c65c16f822669a0674efcaf03 (diff)
downloadPeerTube-22f25c740bf3eb24d9988ab6add8e1a6aec1b0bd.tar.gz
PeerTube-22f25c740bf3eb24d9988ab6add8e1a6aec1b0bd.tar.zst
PeerTube-22f25c740bf3eb24d9988ab6add8e1a6aec1b0bd.zip
Recover HLS video with duration inconsistency
With audio longer than video
-rw-r--r--client/src/assets/player/p2p-media-loader/hls-plugin.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/client/src/assets/player/p2p-media-loader/hls-plugin.ts b/client/src/assets/player/p2p-media-loader/hls-plugin.ts
index 71c31696a..2aa691f05 100644
--- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts
+++ b/client/src/assets/player/p2p-media-loader/hls-plugin.ts
@@ -146,7 +146,9 @@ class Html5Hlsjs {
146 } 146 }
147 147
148 duration () { 148 duration () {
149 return this._duration || this.videoElement.duration || 0 149 if (!isNaN(this.videoElement.duration)) return this.videoElement.duration
150
151 return this._duration || 0
150 } 152 }
151 153
152 seekable () { 154 seekable () {
@@ -366,6 +368,7 @@ class Html5Hlsjs {
366 368
367 this.isLive = data.details.live 369 this.isLive = data.details.live
368 this.dvrDuration = data.details.totalduration 370 this.dvrDuration = data.details.totalduration
371
369 this._duration = this.isLive ? Infinity : data.details.totalduration 372 this._duration = this.isLive ? Infinity : data.details.totalduration
370 }) 373 })
371 374