HTML Audio/Video DOM networkState Property

❮ HTML Audio/Video DOM Reference

Example

var vid = document.getElementById("myVideo");

function myFunction() {
  alert(vid.networkState);
}

Meaning

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


Standard Syntax

audio|video.networkState



Browser Support




Status







Return Value

Type Description
number Returns 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