HTML5 introduced a new <video>
element to play video files directly in the browser. Prior to this, browsers had to use plugins, such as Flash Player, Real Player, or Quick Time to play video files. The <video>
element is a lightweight alternative, and this recipe shows you how to use it in your app to view videos.
Copy the full code of this recipe from the code/11/video
folder. The video snips are available in the code/resources/video
folder. You can launch this code using the URL: http://localhost:8080/11/video/main.html
.
The steps to be followed are:
Create
main.html
with the<video>
element in its page content:<div data-role='content'> <video controls autoplay preload='auto' width='300' height='300'> <source src='../../resources/video/spiral.mp4' type='video/mpeg' /> <source src='../../resources/video/spiral.ogv' type='video/ogg' /> <source...