<div class="row">
<div class="col-md-12">
- <div class="embed-responsive embed-responsive-19by9">
+ <!-- We need the video container for videojs so we just hide it -->
+ <div [hidden]="videoNotFound" class="embed-responsive embed-responsive-19by9">
<video id="video-container" class="video-js vjs-default-skin vjs-big-play-centered"></video>
</div>
+
+ <div *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div>
</div>
</div>
playerElement: Element;
uploadSpeed: number;
video: Video = null;
+ videoNotFound = false;
private errorTimer: NodeJS.Timer;
private sub: any;
this.setOpenGraphTags();
this.loadVideo();
},
- error => alert(error.text)
+ error => {
+ this.videoNotFound = true;
+ }
);
});
console.log('Removing video from webtorrent.');
clearInterval(this.torrentInfosInterval);
clearTimeout(this.errorTimer);
- this.webTorrentService.remove(this.video.magnetUri);
+
+ if (this.video !== null) {
+ this.webTorrentService.remove(this.video.magnetUri);
+ }
// Remove player
videojs(this.playerElement).dispose();