+ });
+
+ // Refresh each second
+ this._interval = setInterval(() => {
+ this.downloadSpeed = torrent.downloadSpeed;
+ this.uploadSpeed = torrent.uploadSpeed;
+ this.numPeers = torrent.numPeers;
+ }, 1000);
+ });
+ }
+
+ routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction) : any {
+ console.log('Removing video from webtorrent.');
+ clearInterval(this._interval);
+ this.client.remove(this.video.magnetUri);
+ return true;