Home >Web Front-end >H5 Tutorial >HTML5 actual combat and analysis of media elements (2. Attributes of media elements)
When it comes to media elements in HTML5, we have a lot to talk about. We have just introduced the usage and introduction of media elements, but we have not yet introduced the related attributes of media elements, so today I will introduce to you some information about media elements in HTML5. Related properties of media elements.
Autoplay: The data type is a Boolean value. Gets or sets the autoplay flag to determine whether the media will automatically play.
buffered: The data type is a time range, indicating the downloaded buffered time range object
bufferedBytes: The data type is a byte range, Represents the downloaded buffered byte range object
bufferingRate: The data type is an integer, the average number of bits received per second during the download process
bufferingThrottled: The data type is a Boolean value, indicating whether the browser has throttled the buffer
Controls: The data type is a Boolean value, gets or sets the attributes of controls, displays or Hide user control interface.
CurrentLoop: The data type is an integer, the number of times the media file has been looped.
CurrentSrc: The data type is a string, indicating the URL of the currently playing media file (read-only).
CurrentTime: The data type is a floating point number, indicating the number of seconds that has been played.
DefaultPlaybackRate: The data type is a floating point number, which means to get or set the default playback speed. The default value is 1.0 seconds
Duration: The data type is a floating point number, indicating the total time of media playback (seconds).
ended: The data type is a Boolean value, indicating whether the media file has been played.
loop: The data type is a Boolean value, indicating whether the media plays in a loop.
Muted: The data type is a Boolean value, indicating whether to mute or not.
networkState: The data type is integer. Indicates the current media network connection status. 0 means empty; 1 means loading; 2 means loading data; 3 means the first frame has been loaded; 4 means loading is complete.
Paused: The data type is a Boolean value, indicating whether the media is paused.
playbackRate: Data type floating point number. Indicates getting or setting the current playback speed. Users can change this value to make media playback faster or slower. This is different from defaultPlaybackRate which can only be modified by developers.
Played: Data type time range, indicating the time range that has been played so far.
readyState: The data type is integer. Indicates whether the media is ready (can be played). 0 means the data is not available; 1 means the current frame can be displayed; 2 means playback can start; 3 means the media can be played from beginning to end.
seekable: The data type is time range. Indicates the time range that can be searched.
Seeking: The data type is Boolean. Indicates whether the media is being moved to a new location within the media file.
src: The data type is string. Indicates media source. This property can be overridden at any time.
start: The data type is floating point number. Indicates getting or setting the starting position of playback in the media file, expressed in seconds.
TotalBytes: The data type is an integer, indicating the total number of bytes required by the current resource.
videoHeight: The data type is integer. Returns the height of the video (not necessarily the element). Suitable for video.
videoWidth: The data type is an integer. Returns the width of the video (not necessarily the element). Suitable for video.
Volume: The data type is a floating point number. Indicates getting or setting the current volume. The value is 0.0-1.0.
The above is the content of HTML5 actual combat and analysis of media elements (2. Attributes of media elements). For more related content, please pay attention to the PHP Chinese website (www.php.cn )!