top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How can we embed Audio or video in HTML 5

+3 votes
How can we embed Audio or video in HTML 5
posted Jan 26, 2014 by Prachi Agarwal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Embedding video

Case 1:

<video width="640" height="360" src="/demo/google_main.mp4?2" autobuffer>
    <div class="fallback">
        <p>You must have an HTML5 capable browser.</p>

Case 2: You can embed your video using the tag for browsers that support HTML 5 and fallback on Flash for those that don’t.

<video src="video.mp4" controls>
    <object data="player.swf" type="application/x-shockwave-flash">
        <param value="player.swf" name="movie"/>

Embedding Audio

The audio tag is more or less a duplicate of the video tag. The same codec limitations apply — Mozilla only supports Ogg Vorbis files, while Safari can handle pretty much anything QuickTime can.

<audio src="/music/myaudio.ogg" autoplay>
    Sorry, your browser does not support the <audio> element.
answer Jan 26, 2014 by Sheetal Chauhan
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.