HTML and CSS Reference
NETWORK_IDLE Numeric value: 1 (the network is temporarily idle).
NETWORK_LOADING Numeric value: 2 (the network is currently active).
NETWORK_NO_SOURCE Numeric value: 3 (no source has been set on the media element).
Returns a value that expresses the current state of the element, with respect to rendering
the current playback position.
Numeric value: 0 (no data has yet been loaded).
Numeric value: 1 (enough data has loaded to provide media metadata).
Numeric value: 2 (enough data is available to play the current frame, but not enough for
Numeric value: 3 (enough data is available to play several frames into the future).
Numeric value: 4 (enough data is available and continuing to become available that the
media can be streamed).
playing video on the canplaythrough event
The next listing shows a simple example of how to use the HTMLMediaEvent interface
events and investigate the networkState and readyState . Insert this code in place
of the $(document).ready part of listing 8.4 .
Listing 8.5. index.html—Capturing HTMLMediaElement interface events