Recover HLS video with duration inconsistency

With audio longer than video
pull/4606/head
Chocobozzz 2021-12-02 13:45:32 +01:00
parent 51e9e152f7
commit 22f25c740b
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 4 additions and 1 deletions

View File

@ -146,7 +146,9 @@ class Html5Hlsjs {
}
duration () {
return this._duration || this.videoElement.duration || 0
if (!isNaN(this.videoElement.duration)) return this.videoElement.duration
return this._duration || 0
}
seekable () {
@ -366,6 +368,7 @@ class Html5Hlsjs {
this.isLive = data.details.live
this.dvrDuration = data.details.totalduration
this._duration = this.isLive ? Infinity : data.details.totalduration
})