Audio networkState attribute

Definition and usage

networkState The property returns the current network state (active) of the audio.

Instance

Get the current network state of the audio:

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

Try it yourself

Syntax

audioObject.networkState

Return value

Type Description
Number

Represents the current network state of the audio element:

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

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support