YouTip LogoYouTip

Prop Video Networkstate

HTML DOM Video networkState Property

HTML DOM Video networkState Property

Video Object Reference Video Object

Example

Get the current network state of the video:

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

x output will be:

1 // The video is active and has selected a resource, but is not using the network

Try it yourself Β»


Definition and Usage

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


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The networkState property is supported in all major browsers.

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


Syntax

videoObject.networkState

Return Value

Type Description
Number Represents 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 has selected a resource, but is not using the network
  • 2 = NETWORK_LOADING - The browser is downloading data
  • 3 = NETWORK_NO_SOURCE - No audio/video source was found

Video Object Reference Video Object

← Prop Video NetworkstateProp Video Muted β†’