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'
@ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent
@ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent
- player: videojs.Player
+ player: any
playerElement: HTMLVideoElement
userRating: UserVideoRateType = null
video: VideoDetails = null
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)
})
this.checkUserRating()
}
- private setRating (nextRating) {
+ private setRating (nextRating: string) {
let method
switch (nextRating) {
case 'like':
.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)
)
}