HTML and CSS Reference
In-Depth Information
There are also some methods of HTMLVideoElement that are necessary when playing video
in conjunction with JavaScript and Canvas:
play()
A method used to start playing a video.
pause()
A method used to pause a video that is playing.
Additionally, there are some properties you can use to check the status of a video,
including:
duration
The length of the video in seconds.
currentTime
The current playing time of the video in seconds. This can be used in conjunction
with duration for some interesting effects, which we will explore later.
ended
true or false , depending on whether the video has finished playing.
muted
true or false . Used to inquire whether the sound of the playing video has been
muted.
paused
true or false . Used to inquire whether the video is currently paused.
There are even more properties that exist for HTMLVideoElement . Check
them out at http://www.w3.org/2010/05/video/mediaevents.html .
Plain-Vanilla Video Embed
To demonstrate a plain-vanilla embed, we are going to work under our previously
established rules for video formats. We will use three formats because no one format
will work in every browser. We have created a version of the Muir Beach video as
a .webm , an .ogg , and a .mp4 . For the rest of this chapter, we will use all three formats
in all of our video embeds.
Search WWH ::




Custom Search