Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix exception when getting 404 in video watch

Chocobozzz2ed6a0aedc2d
diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts
index dbe391fff5..db3e1cdd6e 100644
--- a/client/src/app/videos/video-watch/video-watch.component.ts
+++ b/client/src/app/videos/video-watch/video-watch.component.ts
@@ -66,11 +66,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
}
ngOnDestroy () {
- // Remove WebTorrent stuff
- console.log('Removing video from webtorrent.')
-
- // Remove player
- videojs(this.playerElement).dispose()
+ // Remove player if it exists
+ if (this.videoNotFound === false) {
+ videojs(this.playerElement).dispose()
+ }
// Unsubscribe subscriptions
this.paramsSub.unsubscribe()