1. Code format
<video width= "height=" controls> <source src= "movie.mp4" type= "video/mp4" > <source src= "m Ovie.ogg "type=" Video/ogg "> Your browser does not support video tags. </video>
Video format and browser support
2. currently, The <video> element supports three video formats: MP4, WebM, and Ogg
Browser |
MP4 |
WebM |
Ogg |
Internet Explorer |
YES |
NO |
NO |
Chrome |
YES |
YES |
YES |
Firefox |
YES |
YES |
YES |
Safari |
YES |
NO |
NO |
Opera |
YES (from Opera 25) |
YES |
YES |
3. MIME type of video format
Format |
Mime-type |
MP4 |
Video/mp4 |
Ogg |
Video/ogg |
WebM |
Video/webm |
4. All Properties
Property |
Describe |
Audiotracks |
Returns the Audiotracklist object that represents the available audio track |
AutoPlay |
Sets or returns whether Audio/video is played after loading is complete |
Buffered |
Returns the Timeranges object that represents the buffered portion of the Audio/video |
Controller |
Returns the Mediacontroller object that represents the current media controller for Audio/video |
Controls |
Sets or returns whether the Audio/video display controls (such as play/pause, etc.) |
Crossorigin |
Set or return the CORS settings for Audio/video |
Currentsrc |
Returns the current Audio/video URL |
CurrentTime |
Sets or returns the current playback position in the Audio/video (in Seconds) |
defaultmuted |
Sets or returns whether Audio/video is muted by default |
Defaultplaybackrate |
Sets or returns the default playback speed for Audio/video |
Duration |
Returns the length of the current Audio/video (in Seconds) |
Ended |
Returns whether the Audio/video playback has ended |
Error |
Returns the Mediaerror object that represents the Audio/video error status |
Loop |
Sets or returns whether Audio/video should be played back at the end |
MediaGroup |
Sets or returns the combination of Audio/video (used to connect multiple audio/video elements) |
Muted |
Sets or returns whether Audio/video is muted |
Networkstate |
Returns the current network status of Audio/video |
Paused |
Sets or returns whether Audio/video is paused |
Playbackrate |
Sets or returns the speed of Audio/video playback |
Played |
Returns the Timeranges object that represents the Audio/video played part |
Preload |
Sets or returns whether Audio/video should be loaded in a page-loaded backward line |
ReadyState |
Returns the current ready state of Audio/video |
Seekable |
Returns the Timeranges object that represents the Audio/video addressable section |
Seeking |
Returns whether the user is looking in Audio/video |
Src |
Sets or returns the current source of an audio/video element |
StartDate |
Returns a Date object that represents the current time offset |
Texttracks |
Returns a Texttracklist object that represents the available text track |
Videotracks |
Returns a Videotracklist object that represents the available video tracks |
Volume |
Sets or returns the Audio/video volume |
5. Common label Properties
Src
Controls
Autoplay
Preload (auto,none,metadata)
Poster (video Exclusive)
Loop
Width/height (video Exclusive)
6. Common JS Programming properties
Paused (boolean/read only)
Ended (boolean/read Only)
Volume (read/write) (0~1)
Muted (boolean/read and Write)
7. All Methods
Method |
Describe |
Addtexttrack () |
Add a new text track to Audio/video |
Canplaytype () |
Detects if the browser can play the specified audio/video type |
Load () |
Reload Audio/video Elements |
Play () |
Start playing Audio/video |
Pause () |
Pauses the currently playing Audio/video |
8. Event Monitoring
Event |
Describe |
Abort |
When the audio/video load has been discarded |
Canplay |
When the browser can play Audio/video |
Canplaythrough |
When the browser can play without buffering |
Durationchange |
When the length of the Audio/video has changed |
Emptied |
When the current playlist is empty |
Ended |
When the current playlist has ended |
Error |
When an error occurs during Audio/video loading |
Loadeddata |
When the browser has loaded the current frame of audio/video |
Loadedmetadata |
When the browser has loaded Audio/video metadata |
Loadstart |
When the browser starts looking for Audio/video |
Pause |
When Audio/video is paused |
Play |
When Audio/video has started or is no longer paused |
Playing |
When the Audio/video is ready after it has been paused or stopped due to buffering |
Progress |
When the browser is downloading Audio/video |
Ratechange |
When the Audio/video playback speed has changed |
seeked |
When the user has moved/jumped to a new location in Audio/video |
Seeking |
When the user starts to Move/jump to a new location in the Audio/video |
Stalled |
When the browser tries to get media data, but the data is not available |
Suspend |
When the browser deliberately does not get media data |
Timeupdate |
When the current playback position has changed |
Volumechange |
When the volume has changed |
Waiting |
When the video stops because it needs to buffer the next frame |
HTML5 Video Tag