diff --git a/types/video.js/index.d.ts b/types/video.js/index.d.ts index 9bcc8e858e..2c2457e3ea 100644 --- a/types/video.js/index.d.ts +++ b/types/video.js/index.d.ts @@ -3721,6 +3721,13 @@ declare namespace videojs { HaveEnoughData = 4 } + enum NetworkState { + Empty = 0, + Idle = 1, + Loading = 2, + NoSource = 3 + } + /** * An instance of the `Player` class is created when any of the Video.js setup methods * are used to initialize a video. @@ -4257,6 +4264,13 @@ declare namespace videojs { muted(): boolean; + /** + * Returns the current state of network activity for the element + * + * @return The current network state + */ + networkState(): NetworkState; + /** * Pause the video playback * @check diff --git a/types/video.js/video.js-tests.ts b/types/video.js/video.js-tests.ts index 910085557a..e21d7fe581 100644 --- a/types/video.js/video.js-tests.ts +++ b/types/video.js/video.js-tests.ts @@ -61,6 +61,8 @@ videojs("example_video_1").ready(function() { this.requestFullscreen(); + const networkState: videojs.NetworkState = this.networkState(); + testEvents(this); testComponents(this);