how do we get a video to play in HTML? First you need an actual video in the right format. Opera supports Ogg/Theora/Vorbis, which is also supported by Firefox and Chrome.
If you have a video around you want to play but it’s not in Ogg/Theora/Vorbis, you need to convert it. You can use Firefogg or ffmpeg2theora or other programs to do this; Dive into HTML5 is an online book which covers how to do this step-by-step. It also covers how to convert to MPEG-4/H.264/AAC.
So now you have a video lying around on your server (or your local disk), and you want to play it in HTML. Use the following markup:
< video src="video.ogv" controls >
video not supported
< /video >The controls attribute instructs the browser to provide its own controls. If you want to write your own controls with JavaScript, you just leave out the controls attribute. The browser’s controls can still be enabled by the user from the context menu in Opera, and when scripting is disabled, Opera’s controls are present regardless of the controls attribute.
Leave Your Response