From a436f6c83f021c9f7f8f31f8377eeffe1c43a32a Mon Sep 17 00:00:00 2001 From: Jonathan Viney Date: Wed, 6 Feb 2019 12:22:33 +1300 Subject: [PATCH] [video.js]: add player readyState() --- types/video.js/index.d.ts | 14 ++++++++++++++ types/video.js/video.js-tests.ts | 2 ++ 2 files changed, 16 insertions(+) diff --git a/types/video.js/index.d.ts b/types/video.js/index.d.ts index 62bbf83362..7f64f16b7a 100644 --- a/types/video.js/index.d.ts +++ b/types/video.js/index.d.ts @@ -3713,6 +3713,14 @@ declare namespace videojs { new (player: Player, options?: ComponentOptions): MouseTimeDisplay }; + enum ReadyState { + HaveNothing = 0, + HaveMetadata = 1, + HaveCurrentData = 2, + HaveFutureData = 3, + HaveEnoughData = 4 + } + /** * An instance of the `Player` class is created when any of the Video.js setup methods * are used to initialize a video. @@ -4342,6 +4350,12 @@ declare namespace videojs { */ preload(value?: boolean): string; + /** + * Returns a value that expresses the current state of the element + * with respect to rendering the current playback position. + */ + readyState(): ReadyState; + /** * Calculates how much time is left in the video. Not part * of the native video API. diff --git a/types/video.js/video.js-tests.ts b/types/video.js/video.js-tests.ts index 378a7150f3..910085557a 100644 --- a/types/video.js/video.js-tests.ts +++ b/types/video.js/video.js-tests.ts @@ -57,6 +57,8 @@ videojs("example_video_1").ready(function() { this.height(480); + const readyState: videojs.ReadyState = this.readyState(); + this.requestFullscreen(); testEvents(this);