Fix exception when getting 404 in video watch

This commit is contained in:
Chocobozzz 2017-10-09 11:25:41 +02:00
parent 14d3270f36
commit 2ed6a0aedc
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 4 additions and 5 deletions

View File

@ -66,11 +66,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
} }
ngOnDestroy () { ngOnDestroy () {
// Remove WebTorrent stuff // Remove player if it exists
console.log('Removing video from webtorrent.') if (this.videoNotFound === false) {
videojs(this.playerElement).dispose()
// Remove player }
videojs(this.playerElement).dispose()
// Unsubscribe subscriptions // Unsubscribe subscriptions
this.paramsSub.unsubscribe() this.paramsSub.unsubscribe()