Video networkStateProperty

Video 对象参考手册Video Object

Examples

Get the current network state of the video:

var x = document.getElementById("myVideo").networkState;

xThe output result is:

1 // The video is valid and the resource has been selected; no network is being used

Try it Yourself »

Definition and Usage

The networkState property returns the current network state of the audio/video.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the networkState property.

Note:Internet Explorer 8 and earlier IE versions do not support this property.


Syntax

videoObject.networkState

Return Value

Type Description
Numeric value

Indicates the current network state of the audio/video element:

  • 0 = NETWORK_EMPTY - The audio/video has not been initialized yet
  • 1 = NETWORK_IDLE - The audio/video is active and the resource has been selected, but the network is not being used
  • 2 = NETWORK_LOADING - The browser is downloading data
  • 3 = NETWORK_NO_SOURCE - No audio/video source was found


Video 对象参考手册Video Object Other Extensions