您的位置:首页 > Web前端 > HTML5

HTML5 Video Events and API

2016-07-18 19:20 260 查看

HTML5 Video Events and API

This page demonstrates the new HTML5 video element, its media
API, and the media events. Play, pause, and seek in the entire video, change the volume, mute, change the playback rate (including going into negative values).
See the effect on the video and on the underlying events and properties.

load() play()
pause()

currentTime+=10 currentTime-=10 currentTime=50

playbackRate++ playbackRate-- playbackRate+=0.1
playbackRate-=0.1

volume+=0.1 volume-=0.1 muted=true
muted=false

Sintel teaser Bunny trailer Bunny movie
Test movie
Media Events

loadstart4progress33suspend6abort3error0
emptied3stalled1loadedmetadata2loadeddata2canplay2
canplaythrough2playing0waiting2seeking0seeked0
ended0durationchange2timeupdate2play2pause2
ratechange6resize2volumechange0
Media Properties

errorsrcsrcObject
currentSrchttp://media.w3.org/2010/05/sintel/trailer.webmcrossOriginnetworkState2
preloadnonebuffered[object TimeRanges]readyState4
seekingfalsecurrentTime0duration52.663
pausedtruedefaultPlaybackRate1playbackRate1
played[object TimeRanges]seekable[object TimeRanges]endedfalse
autoplayfalseloopfalsemediaGroup
controllercontrolstruevolume1
mutedfalsedefaultMutedfalseaudioTracks
videoTrackstextTracks[object TextTrackList]width0
height0videoWidth640videoHeight272
posterhttp://media.w3.org/2010/05/sintel/poster.png
MediaController Events

Not implemented
MediaController Properties

Not implemented
canPlayType

video/mp4video/webm
"maybe""maybe"
Tracks

AudioVideoText
??0

Limitations

Some events may be fired despite the lack of effect on the video itself, in particular while trying to change the playback rate;
Not all conditions are necessarily there to generate every single possible event, such as
stalled
or
emptied
;
The rendered page may not be updated while the video is playing. Thus you may see plenty of
timeupdate
events counted after the video is paused/stopped;

plh@w3.org - November 2014
Many, many thanks to the Blender Foundation and the community around the blender
project.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: