Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML Audio/Video DOM networkState Property

❮ HTML Audio/Video DOM Reference

Example

Get the current network state of the video:

var vid = document.getElementById("myVideo");
alert(vid.networkState);
Try it Yourself »

Definition and Usage

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


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
networkState Yes 9.0 3.5 Yes Yes

Syntax

audio|video.networkState

Return Value

Type Description
Number Represents the current network state of the audio/video element:
  • 0 = NETWORK_EMPTY - audio/video has not yet been initialized
  • 1 = NETWORK_IDLE - audio/video is active and has selected a resource, but is not using the network
  • 2 = NETWORK_LOADING - browser is downloading data
  • 3 = NETWORK_NO_SOURCE - no audio/video source found

❮ HTML Audio/Video DOM Reference