uploadSpeed: number
userRating: UserVideoRateType = null
video: Video = null
- videoNotFound = false
+ videoPlayerLoaded = false
private paramsSub: Subscription
this.videoService.getVideo(uuid).subscribe(
video => this.onVideoFetched(video),
- error => {
- console.error(error)
- this.videoNotFound = true
- }
+ error => console.error(error)
)
})
}
ngOnDestroy () {
// Remove player if it exists
- if (this.videoNotFound === false) {
+ if (this.videoPlayerLoaded === true) {
videojs(this.playerElement).dispose()
}
observable.subscribe(
res => {
if (res === false) {
+
return this.router.navigate([ '/videos/list' ])
}
}
}
+ this.videoPlayerLoaded = true
+
const self = this
videojs(this.playerElement, videojsOptions, function () {
self.player = this