mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-26 02:30:37 -06:00
Fix live start time
Use undefined to not break live edge position set by hls.js
This commit is contained in:
parent
19dbbdafcc
commit
a12d94f30d
@ -695,6 +695,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
const getStartTime = () => {
|
||||
if (video.isLive) return undefined
|
||||
|
||||
const byUrl = urlOptions.startTime !== undefined
|
||||
const byHistory = video.userHistory && (!this.playlist || urlOptions.resume !== undefined)
|
||||
const byLocalStorage = getStoredVideoWatchHistory(video.uuid)
|
||||
|
@ -409,10 +409,13 @@ class PeerTubePlugin extends Plugin {
|
||||
|
||||
// Prefer canplaythrough instead of canplay because Chrome has issues with the second one
|
||||
this.player.one('canplaythrough', () => {
|
||||
const startTime = this.options.startTime() || 0
|
||||
debugLogger('Start the video at ' + startTime)
|
||||
const startTime = this.options.startTime()
|
||||
|
||||
this.player.currentTime(timeToInt(startTime))
|
||||
if (startTime !== null && startTime !== undefined) {
|
||||
debugLogger('Start the video at ' + startTime)
|
||||
|
||||
this.player.currentTime(timeToInt(startTime))
|
||||
}
|
||||
|
||||
if (this.options.stopTime()) {
|
||||
const stopTime = timeToInt(this.options.stopTime())
|
||||
|
Loading…
Reference in New Issue
Block a user