aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.html5
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.scss8
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.ts10
3 files changed, 20 insertions, 3 deletions
diff --git a/client/src/app/videos/video-watch/video-watch.component.html b/client/src/app/videos/video-watch/video-watch.component.html
index cb91bae7e..2dfc25f56 100644
--- a/client/src/app/videos/video-watch/video-watch.component.html
+++ b/client/src/app/videos/video-watch/video-watch.component.html
@@ -15,9 +15,12 @@
15 15
16<div class="row"> 16<div class="row">
17 <div class="col-md-12"> 17 <div class="col-md-12">
18 <div class="embed-responsive embed-responsive-19by9"> 18 <!-- We need the video container for videojs so we just hide it -->
19 <div [hidden]="videoNotFound" class="embed-responsive embed-responsive-19by9">
19 <video id="video-container" class="video-js vjs-default-skin vjs-big-play-centered"></video> 20 <video id="video-container" class="video-js vjs-default-skin vjs-big-play-centered"></video>
20 </div> 21 </div>
22
23 <div *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div>
21 </div> 24 </div>
22</div> 25</div>
23 26
diff --git a/client/src/app/videos/video-watch/video-watch.component.scss b/client/src/app/videos/video-watch/video-watch.component.scss
index fe23b849f..45446e175 100644
--- a/client/src/app/videos/video-watch/video-watch.component.scss
+++ b/client/src/app/videos/video-watch/video-watch.component.scss
@@ -3,6 +3,14 @@
3 height: 100%; 3 height: 100%;
4} 4}
5 5
6#video-not-found {
7 height: 300px;
8 line-height: 300px;
9 margin-top: 50px;
10 text-align: center;
11 font-weight: bold;
12}
13
6.embed-responsive { 14.embed-responsive {
7 height: 500px; 15 height: 500px;
8} 16}
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();