1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 01:39:37 +02:00

Fix client player error on fast restream

This commit is contained in:
Chocobozzz 2024-08-09 09:42:58 +02:00
parent d47d95cb6f
commit 25684e837c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
12 changed files with 141 additions and 41 deletions

View file

@ -317,17 +317,20 @@ export class PeerTubeEmbed {
if (video.isLive) {
this.liveManager.listenForChanges({
video,
onPublishedVideo: () => {
this.liveManager.stopListeningForChanges(video)
this.loadVideoAndBuildPlayer({ uuid: video.uuid, forceAutoplay: true })
}
},
onForceEnd: () => this.endLive(video, translations)
})
if (video.state.id === VideoState.WAITING_FOR_LIVE || video.state.id === VideoState.LIVE_ENDED) {
this.liveManager.displayInfo({ state: video.state.id, translations })
this.peertubePlayer.disable()
} else {
this.correctlyHandleLiveEnding(translations)
this.player.one('ended', () => this.endLive(video, translations))
}
}
@ -369,13 +372,13 @@ export class PeerTubeEmbed {
// ---------------------------------------------------------------------------
private correctlyHandleLiveEnding (translations: Translations) {
this.player.one('ended', () => {
// Display the live ended information
this.liveManager.displayInfo({ state: VideoState.LIVE_ENDED, translations })
private endLive (video: VideoDetails, translations: Translations) {
// Display the live ended information
this.liveManager.displayInfo({ state: VideoState.LIVE_ENDED, translations })
this.peertubePlayer.disable()
})
this.peertubePlayer.unload()
this.peertubePlayer.disable()
this.peertubePlayer.setPoster(video.previewPath)
}
private async handlePasswordError (err: PeerTubeServerError) {