X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=client%2Fangular%2Fvideos%2Fcomponents%2Fwatch%2Fvideos-watch.component.ts;h=3eb005d07b4debd23ca197fa8a646729703fe10f;hb=471bc22f19767c1cb1e7ba7ad0ddf0ff5f0e88f4;hp=d2203727e462e59d5394ae85f717b708d20c947c;hpb=e9a2578e952a361b042fee45d211c6f88d89209e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/angular/videos/components/watch/videos-watch.component.ts b/client/angular/videos/components/watch/videos-watch.component.ts index d2203727e..3eb005d07 100644 --- a/client/angular/videos/components/watch/videos-watch.component.ts +++ b/client/angular/videos/components/watch/videos-watch.component.ts @@ -1,12 +1,12 @@ -import { Component, OnInit, ElementRef } from 'angular2/core'; -import { RouteParams, CanDeactivate, ComponentInstruction } from 'angular2/router'; +import { Component, OnInit, ElementRef } from '@angular/core'; +import { RouteParams, CanDeactivate, ComponentInstruction } from '@angular/router-deprecated'; import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; // TODO import it with systemjs declare var WebTorrent: any; -import { Video } from '../../models/video'; -import { VideosService } from '../../services/videos.service'; +import { Video } from '../../video'; +import { VideosService } from '../../videos.service'; @Component({ selector: 'my-video-watch', @@ -20,8 +20,9 @@ export class VideosWatchComponent implements OnInit, CanDeactivate { downloadSpeed: number; uploadSpeed: number; numPeers: number; + loading: boolean = false; - private _interval: number; + private _interval: NodeJS.Timer; private client: any; constructor( @@ -42,9 +43,11 @@ export class VideosWatchComponent implements OnInit, CanDeactivate { } loadVideo(video: Video) { + this.loading = true; this.video = video; console.log('Adding ' + this.video.magnetUri + '.'); this.client.add(this.video.magnetUri, (torrent) => { + this.loading = false; console.log('Added ' + this.video.magnetUri + '.'); torrent.files[0].appendTo(this._elementRef.nativeElement.querySelector('.embed-responsive'), (err) => { if (err) {