aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch/video-watch.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/video-watch/video-watch.component.ts')
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.ts10
1 files changed, 8 insertions, 2 deletions
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 0309938c0..3dab2bbb7 100644
--- a/client/src/app/videos/video-watch/video-watch.component.ts
+++ b/client/src/app/videos/video-watch/video-watch.component.ts
@@ -28,6 +28,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
28 playerElement: Element; 28 playerElement: Element;
29 uploadSpeed: number; 29 uploadSpeed: number;
30 video: Video = null; 30 video: Video = null;
31 videoNotFound = false;
31 32
32 private errorTimer: NodeJS.Timer; 33 private errorTimer: NodeJS.Timer;
33 private sub: any; 34 private sub: any;
@@ -51,7 +52,9 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
51 this.setOpenGraphTags(); 52 this.setOpenGraphTags();
52 this.loadVideo(); 53 this.loadVideo();
53 }, 54 },
54 error => alert(error.text) 55 error => {
56 this.videoNotFound = true;
57 }
55 ); 58 );
56 }); 59 });
57 60
@@ -73,7 +76,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
73 console.log('Removing video from webtorrent.'); 76 console.log('Removing video from webtorrent.');
74 clearInterval(this.torrentInfosInterval); 77 clearInterval(this.torrentInfosInterval);
75 clearTimeout(this.errorTimer); 78 clearTimeout(this.errorTimer);
76 this.webTorrentService.remove(this.video.magnetUri); 79
80 if (this.video !== null) {
81 this.webTorrentService.remove(this.video.magnetUri);
82 }
77 83
78 // Remove player 84 // Remove player
79 videojs(this.playerElement).dispose(); 85 videojs(this.playerElement).dispose();