]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/video-watch.component.ts
NoImplicitAny flag true (#1157)
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / video-watch.component.ts
index c5deddf050272affacdef1bdb69789994bc6e010..ed5e723c93fa7b4665244137535df5cab4c3bad6 100644 (file)
@@ -7,7 +7,7 @@ import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-supp
 import { MetaService } from '@ngx-meta/core'
 import { NotificationsService } from 'angular2-notifications'
 import { forkJoin, Subscription } from 'rxjs'
-import * as videojs from 'video.js'
+const videojs = require('video.js')
 import 'videojs-hotkeys'
 import { Hotkey, HotkeysService } from 'angular2-hotkeys'
 import * as WebTorrent from 'webtorrent'
@@ -45,7 +45,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
   @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent
   @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent
 
-  player: videojs.Player
+  player: any
   playerElement: HTMLVideoElement
   userRating: UserVideoRateType = null
   video: VideoDetails = null
@@ -435,7 +435,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
     this.zone.runOutsideAngular(async () => {
       videojs(this.playerElement, videojsOptions, function () {
         self.player = this
-        this.on('customError', (event, data) => self.handleError(data.err))
+        this.on('customError', (data: any) => self.handleError(data.err))
 
         addContextMenu(self.player, self.video.embedUrl)
       })
@@ -448,7 +448,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
     this.checkUserRating()
   }
 
-  private setRating (nextRating) {
+  private setRating (nextRating: string) {
     let method
     switch (nextRating) {
       case 'like':
@@ -466,11 +466,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
           .subscribe(
             () => {
               // Update the video like attribute
-              this.updateVideoRating(this.userRating, nextRating)
-              this.userRating = nextRating
+              this.updateVideoRating(this.userRating, nextRating as VideoRateType)
+              this.userRating = nextRating as UserVideoRateType
             },
 
-            err => this.notificationsService.error(this.i18n('Error'), err.message)
+            (err: any) => this.notificationsService.error(this.i18n('Error'), err.message)
           )
   }