Home  >  Article  >  Web Front-end  >  html5 returns the attribute networkState of the current network status (activity) of audio/video

html5 returns the attribute networkState of the current network status (activity) of audio/video

黄舟
黄舟Original
2017-11-09 09:51:062143browse

Example

Get the current network status of video:

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

Definition and usage

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

Browser support

All major browsers support the networkState attribute.

Note: This attribute is not supported in Internet Explorer 8 or earlier browsers.

Syntax

audio|video.networkState

Return value

TypeDescription
Numeric value

represents the current network status of the audio/video element:

  • 0 = NETWORK_EMPTY - Audio/video has not been initialized

  • 1 = NETWORK_IDLE - The audio/video is active and the resource is selected, but the network is not being used

  • 2 = NETWORK_LOADING - The browser is downloading data

  • 3 = NETWORK_NO_SOURCE - Audio/video source not found

##Instance

Get Current network status of the video:

 
 
 

The above is the detailed content of html5 returns the attribute networkState of the current network status (activity) of audio/video. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn