aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch/video-watch.component.ts
diff options
context:
space:
mode:
authorBO41 <lukasw41@gmail.com>2018-10-18 09:08:59 +0200
committerRigel Kent <par@rigelk.eu>2018-10-18 09:08:59 +0200
commit244b4ae3973bc1511464a08158a123767f83179c (patch)
tree24f4399489167bc92921e3fe0c1c04a87d7c1161 /client/src/app/videos/+video-watch/video-watch.component.ts
parent28e51e831bd121f063600a597d7b02f8fd846de9 (diff)
downloadPeerTube-244b4ae3973bc1511464a08158a123767f83179c.tar.gz
PeerTube-244b4ae3973bc1511464a08158a123767f83179c.tar.zst
PeerTube-244b4ae3973bc1511464a08158a123767f83179c.zip
NoImplicitAny flag true (#1157)
this enables the `noImplicitAny` flag in the Typescript compiler > When the noImplicitAny flag is true and the TypeScript compiler cannot infer the type, it still generates the JavaScript files, but it also reports an error. Many seasoned developers prefer this stricter setting because type checking catches more unintentional errors at compile time. closes: #1131 replaces #1137
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.ts14
1 files changed, 7 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 c5deddf05..ed5e723c9 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,7 @@ import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-supp
7import { MetaService } from '@ngx-meta/core' 7import { MetaService } from '@ngx-meta/core'
8import { NotificationsService } from 'angular2-notifications' 8import { NotificationsService } from 'angular2-notifications'
9import { forkJoin, Subscription } from 'rxjs' 9import { forkJoin, Subscription } from 'rxjs'
10import * as videojs from 'video.js' 10const videojs = require('video.js')
11import 'videojs-hotkeys' 11import 'videojs-hotkeys'
12import { Hotkey, HotkeysService } from 'angular2-hotkeys' 12import { Hotkey, HotkeysService } from 'angular2-hotkeys'
13import * as WebTorrent from 'webtorrent' 13import * as WebTorrent from 'webtorrent'
@@ -45,7 +45,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
45 @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent 45 @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent
46 @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent 46 @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent
47 47
48 player: videojs.Player 48 player: any
49 playerElement: HTMLVideoElement 49 playerElement: HTMLVideoElement
50 userRating: UserVideoRateType = null 50 userRating: UserVideoRateType = null
51 video: VideoDetails = null 51 video: VideoDetails = null
@@ -435,7 +435,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
435 this.zone.runOutsideAngular(async () => { 435 this.zone.runOutsideAngular(async () => {
436 videojs(this.playerElement, videojsOptions, function () { 436 videojs(this.playerElement, videojsOptions, function () {
437 self.player = this 437 self.player = this
438 this.on('customError', (event, data) => self.handleError(data.err)) 438 this.on('customError', (data: any) => self.handleError(data.err))
439 439
440 addContextMenu(self.player, self.video.embedUrl) 440 addContextMenu(self.player, self.video.embedUrl)
441 }) 441 })
@@ -448,7 +448,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
448 this.checkUserRating() 448 this.checkUserRating()
449 } 449 }
450 450
451 private setRating (nextRating) { 451 private setRating (nextRating: string) {
452 let method 452 let method
453 switch (nextRating) { 453 switch (nextRating) {
454 case 'like': 454 case 'like':
@@ -466,11 +466,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
466 .subscribe( 466 .subscribe(
467 () => { 467 () => {
468 // Update the video like attribute 468 // Update the video like attribute
469 this.updateVideoRating(this.userRating, nextRating) 469 this.updateVideoRating(this.userRating, nextRating as VideoRateType)
470 this.userRating = nextRating 470 this.userRating = nextRating as UserVideoRateType
471 }, 471 },
472 472
473 err => this.notificationsService.error(this.i18n('Error'), err.message) 473 (err: any) => this.notificationsService.error(this.i18n('Error'), err.message)
474 ) 474 )
475 } 475 }
476 476