HTML and CSS Reference
In-Depth Information
Property/values
Description
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.
.readyState
HAVE_NOTHING
Numeric value: 0 (no data has yet been loaded).
HAVE_METADATA
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
continuous streaming).
HAVE_CURRENT_DATA
HAVE_FUTURE_DATA
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).
HAVE_ENOUGH_DATA
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
 
Search WWH ::




Custom Search