diff options
Diffstat (limited to 'client/src/app/videos/+video-watch/video-watch.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 16 |
1 files changed, 9 insertions, 7 deletions
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 ed5e723c9..65b974037 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -7,7 +7,9 @@ import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-supp | |||
7 | import { MetaService } from '@ngx-meta/core' | 7 | import { MetaService } from '@ngx-meta/core' |
8 | import { NotificationsService } from 'angular2-notifications' | 8 | import { NotificationsService } from 'angular2-notifications' |
9 | import { forkJoin, Subscription } from 'rxjs' | 9 | import { forkJoin, Subscription } from 'rxjs' |
10 | const videojs = require('video.js') | 10 | // FIXME: something weird with our path definition in tsconfig and typings |
11 | // @ts-ignore | ||
12 | import videojs from 'video.js' | ||
11 | import 'videojs-hotkeys' | 13 | import 'videojs-hotkeys' |
12 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | 14 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' |
13 | import * as WebTorrent from 'webtorrent' | 15 | import * as WebTorrent from 'webtorrent' |
@@ -45,7 +47,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
45 | @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent | 47 | @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent |
46 | @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent | 48 | @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent |
47 | 49 | ||
48 | player: any | 50 | player: videojs.Player |
49 | playerElement: HTMLVideoElement | 51 | playerElement: HTMLVideoElement |
50 | userRating: UserVideoRateType = null | 52 | userRating: UserVideoRateType = null |
51 | video: VideoDetails = null | 53 | video: VideoDetails = null |
@@ -435,7 +437,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
435 | this.zone.runOutsideAngular(async () => { | 437 | this.zone.runOutsideAngular(async () => { |
436 | videojs(this.playerElement, videojsOptions, function () { | 438 | videojs(this.playerElement, videojsOptions, function () { |
437 | self.player = this | 439 | self.player = this |
438 | this.on('customError', (data: any) => self.handleError(data.err)) | 440 | this.on('customError', ({ err }: { err: any }) => self.handleError(err)) |
439 | 441 | ||
440 | addContextMenu(self.player, self.video.embedUrl) | 442 | addContextMenu(self.player, self.video.embedUrl) |
441 | }) | 443 | }) |
@@ -448,7 +450,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
448 | this.checkUserRating() | 450 | this.checkUserRating() |
449 | } | 451 | } |
450 | 452 | ||
451 | private setRating (nextRating: string) { | 453 | private setRating (nextRating: VideoRateType) { |
452 | let method | 454 | let method |
453 | switch (nextRating) { | 455 | switch (nextRating) { |
454 | case 'like': | 456 | case 'like': |
@@ -466,11 +468,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
466 | .subscribe( | 468 | .subscribe( |
467 | () => { | 469 | () => { |
468 | // Update the video like attribute | 470 | // Update the video like attribute |
469 | this.updateVideoRating(this.userRating, nextRating as VideoRateType) | 471 | this.updateVideoRating(this.userRating, nextRating) |
470 | this.userRating = nextRating as UserVideoRateType | 472 | this.userRating = nextRating |
471 | }, | 473 | }, |
472 | 474 | ||
473 | (err: any) => this.notificationsService.error(this.i18n('Error'), err.message) | 475 | (err: { message: string }) => this.notificationsService.error(this.i18n('Error'), err.message) |
474 | ) | 476 | ) |
475 | } | 477 | } |
476 | 478 | ||