From 9241cf1a2b1c8b2704bbcba9c620157e39f7f4e2 Mon Sep 17 00:00:00 2001 From: Adam Eisenreich Date: Fri, 3 Aug 2018 19:54:48 +0200 Subject: [PATCH] Fix types from last big addition (#27834) * Fix some type from last big addition * Version * Test player.play * Remove patch version * remove whitespaces --- types/video.js/index.d.ts | 14 +++++++------- types/video.js/video.js-tests.ts | 6 +++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/types/video.js/index.d.ts b/types/video.js/index.d.ts index 3d432fb9b3..8535cf4f16 100644 --- a/types/video.js/index.d.ts +++ b/types/video.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Video.js 7.0 +// Type definitions for Video.js 7.2 // Project: https://github.com/videojs/video.js // Definitions by: Vincent Bortone // Simon Clériot @@ -1962,7 +1962,7 @@ declare namespace videojs { }; interface ControlBarOptions extends ComponentOptions { - VolumePanel?: VolumePanelOptions; + volumePanel?: VolumePanelOptions; } /** @@ -3527,7 +3527,7 @@ declare namespace videojs { * * @return The current content of the modal dialog */ - content(value: Content): any; + content(value?: Content): any; /** * Create the `ModalDialog`'s DOM element @@ -3570,7 +3570,7 @@ declare namespace videojs { * @param [content] * The same rules apply to this as apply to the `content` option. */ - fillWith(content: Content): void; + fillWith(content?: Content): void; /** * Keydown handler. Attached when modal is focused. @@ -4073,7 +4073,7 @@ declare namespace videojs { * * @return The current MediaError when getting (or null) */ - error(err: MediaError | string | number): void; + error(err: MediaError | string | number | null): void; error(): MediaError | null; @@ -4243,7 +4243,7 @@ declare namespace videojs { * is ready to begin playback. For some browsers and all non-ready * situations, this will return `undefined`. */ - play(): Player; + play(): Promise | undefined; /** * Gets or sets the current playback rate. A playback rate of @@ -4741,7 +4741,7 @@ declare namespace videojs { * @return For advanced plugins, a factory function for that plugin. For * basic plugins, a wrapper function that initializes the plugin. */ - registerPlugin(name: string, plugin: (this: Player, options: any) => T): () => T; + registerPlugin(name: string, plugin: (this: Player, ...options: K[]) => T): (...options: K[]) => T; registerPlugin(name: string, plugin: T): () => T; }; diff --git a/types/video.js/video.js-tests.ts b/types/video.js/video.js-tests.ts index d332a430cc..814aec9edd 100644 --- a/types/video.js/video.js-tests.ts +++ b/types/video.js/video.js-tests.ts @@ -2,7 +2,11 @@ import * as videojs from 'video.js'; videojs("example_video_1").ready(function() { // EXAMPLE: Start playing the video. - this.play(); + const playPromise = this.play(); + + if (playPromise) { + playPromise.then(() => {}); + } this.pause();