HTML Audio/Video DOM networkState attribute

Instance

Get the current network status of the video:

myVid=document.getElementById("video1");
alert(myVid.networkState);

Try It Yourself

Definition and Usage

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

Browser Support

All mainstream browsers support the networkState property.

Note:Internet Explorer 8 or earlier browsers do not support this property.

Syntax

audio|video.networkState

Return value

Type Description
Numeric value

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

  • 0 = NETWORK_EMPTY - Audio/video has not been initialized
  • 1 = NETWORK_IDLE - Audio/video is active and the resource is selected, but no network is used
  • 2 = NETWORK_LOADING - Browser is downloading data
  • 3 = NETWORK_NO_SOURCE - Audio/video source not found