Fix broken player on broken video
This commit is contained in:
parent
4434e78c56
commit
568726e48d
|
@ -124,7 +124,6 @@ export class PeerTubePlayer {
|
||||||
|
|
||||||
setPoster (url: string) {
|
setPoster (url: string) {
|
||||||
this.player?.poster(url)
|
this.player?.poster(url)
|
||||||
this.options.playerElement().poster = url
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enable () {
|
enable () {
|
||||||
|
@ -209,7 +208,8 @@ export class PeerTubePlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.player.one('error', () => handleError())
|
this.player.on('video-change', () => alreadyFallback = false)
|
||||||
|
this.player.on('error', () => handleError())
|
||||||
|
|
||||||
this.player.on('network-info', (_, data: PlayerNetworkInfo) => {
|
this.player.on('network-info', (_, data: PlayerNetworkInfo) => {
|
||||||
if (data.source !== 'p2p-media-loader' || isNaN(data.bandwidthEstimate)) return
|
if (data.source !== 'p2p-media-loader' || isNaN(data.bandwidthEstimate)) return
|
||||||
|
|
|
@ -187,6 +187,10 @@ class PeerTubePlugin extends Plugin {
|
||||||
this.player.removeChild(this.errorModal)
|
this.player.removeChild(this.errorModal)
|
||||||
this.errorModal.close()
|
this.errorModal.close()
|
||||||
this.errorModal = undefined
|
this.errorModal = undefined
|
||||||
|
|
||||||
|
if (this.player.loadingSpinner) {
|
||||||
|
this.player.loadingSpinner.show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private initializePlayer () {
|
private initializePlayer () {
|
||||||
|
|
|
@ -87,9 +87,6 @@ class WebVideoPlugin extends Plugin {
|
||||||
|
|
||||||
const oldAutoplayValue = this.player.autoplay()
|
const oldAutoplayValue = this.player.autoplay()
|
||||||
if (options.isUserResolutionChange) {
|
if (options.isUserResolutionChange) {
|
||||||
// Prevent video source element displaying the poster when we change the resolution
|
|
||||||
(this.player.el() as HTMLVideoElement).poster = ''
|
|
||||||
|
|
||||||
this.player.autoplay(false)
|
this.player.autoplay(false)
|
||||||
this.player.addClass('vjs-updating-resolution')
|
this.player.addClass('vjs-updating-resolution')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue