English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The networkState attribute represents the current state of media acquisition on the network.
HTML Audio/Video DOM Reference Manual
Get the current network state of the video:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Audio/Video networkState attribute usage-Basic Tutorial(oldtoolbag.com)</<title> </<head> <body> <button onclick="getNWState()" type="button">Get the current network state of the video</button> <br> <video id="video1" controls="controls" autoplay="autoplay"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support HTML5 video tag. </video> <script> myVid = document.getElementById("video"1); function getNWState() {"}} alert(myVid.networkState); } </script> </body> </html>Test to see ‹/›
The networkState property returns audio/The current network state of the video (active).
IEFirefoxOperaChromeSafari
All mainstream browsers support the networkState property.
Note:Internet Explorer 8 And earlier versions do not support this property.
audio|video.networkState
Type | Description |
---|---|
Number | Represents audio/The current network state of the video element is:
|