From 33c4972d5b54155540267f4c9c9ee55c539b8385 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2017 10:09:18 +0200 Subject: Type webtorrent --- client/src/app/videos/video-watch/video-watch.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'client/src/app/videos/video-watch/video-watch.component.ts') 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 12ddf3eef..6bd6c1f7e 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts @@ -32,7 +32,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { loading = false numPeers: number player: videojs.Player - playerElement: Element + playerElement: HTMLMediaElement uploadSpeed: number userRating: UserVideoRateType = null video: Video = null @@ -41,7 +41,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy { private errorTimer: number private paramsSub: Subscription private errorsSub: Subscription - private warningsSub: Subscription private torrentInfosInterval: number constructor ( @@ -82,8 +81,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { self.player = this }) - this.errorsSub = this.webTorrentService.errors.subscribe(err => this.notificationsService.error('Error', err.message)) - this.warningsSub = this.webTorrentService.errors.subscribe(err => this.notificationsService.alert('Warning', err.message)) + this.errorsSub = this.webTorrentService.errors.subscribe(err => { + const message = typeof err === 'string' ? err : err.message + this.notificationsService.error('Error', message) + }) } ngOnDestroy () { @@ -102,7 +103,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy { // Unsubscribe subscriptions this.paramsSub.unsubscribe() this.errorsSub.unsubscribe() - this.warningsSub.unsubscribe() } loadVideo () { @@ -117,7 +117,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { // So we create a timer to inform the user the load is abnormally long this.errorTimer = window.setTimeout(() => this.loadTooLong(), VideoWatchComponent.LOADTIME_TOO_LONG) - this.webTorrentService.add(this.video.magnetUri, (torrent) => { + this.webTorrentService.add(this.video.magnetUri, torrent => { // Clear the error timer window.clearTimeout(this.errorTimer) // Maybe the error was fired by the timer, so reset it -- cgit v1.2.3