From 244b4ae3973bc1511464a08158a123767f83179c Mon Sep 17 00:00:00 2001 From: BO41 Date: Thu, 18 Oct 2018 09:08:59 +0200 Subject: 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 --- client/src/standalone/videos/embed.ts | 4 ++-- client/src/standalone/videos/test-embed.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'client/src/standalone/videos') diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index ea3436c7c..e5a2d208a 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -17,7 +17,7 @@ import 'core-js/es6/set' // For google bot that uses Chrome 41 and does not understand fetch import 'whatwg-fetch' -import * as vjs from 'video.js' +const vjs = require('video.js') import * as Channel from 'jschannel' import { peertubeTranslate, ResultList, VideoDetails } from '../../../../shared' @@ -304,7 +304,7 @@ class PeerTubeEmbed { this.playerOptions = videojsOptions this.player = vjs(this.videoContainerId, videojsOptions, () => { - this.player.on('customError', (event, data) => this.handleError(data.err)) + this.player.on('customError', (data: any) => this.handleError(data.err)) window[ 'videojsPlayer' ] = this.player diff --git a/client/src/standalone/videos/test-embed.ts b/client/src/standalone/videos/test-embed.ts index dba331e90..b750c2ee6 100644 --- a/client/src/standalone/videos/test-embed.ts +++ b/client/src/standalone/videos/test-embed.ts @@ -66,11 +66,11 @@ window.addEventListener('load', async () => { updateRates() }) - let updateResolutions = resolutions => { + let updateResolutions = ((resolutions: any) => { let resolutionListEl = document.querySelector('#resolution-list') resolutionListEl.innerHTML = '' - resolutions.forEach(resolution => { + resolutions.forEach((resolution: any) => { if (resolution.active) { let itemEl = document.createElement('strong') itemEl.innerText = `${resolution.label} (active)` @@ -87,7 +87,7 @@ window.addEventListener('load', async () => { resolutionListEl.appendChild(itemEl) } }) - } + }) player.getResolutions().then( resolutions => updateResolutions(resolutions)) -- cgit v1.2.3