HTML5 Video tag implemented in Flash Print E-mail
User Rating: / 0

Mike Chambers has create a nice proof of concept that implements the HTML 5 tag using JavaScript and Flash:

asically, this parses out VIDEO element / tag and its attributes, and replaces it with the appropriate OBJECT or EMBED element to display a Flash video player that loads the specified video. It has support for playing back both h264 content and FLVs.

It uses the SWFObject JavaScript library to display the Flash content.

Currently the following VIDEO attributes are implemented:

  • controls
  • poster
  • autoplay
  • width
  • height
  • playcount

The tricky part will be cleanly implementing the VIDEO DOM scripting API, although I believe that that should also be possible.

To get it working, you just need to include the shim along with the video tag:

  2. <script type="text/javascript" src="swfobject/src/swfobject.js"></script>
  3. <script type="text/javascript" src="html5_video.js"></script>
  5. <video src=""
  6.         controls
  7.         poster="testpattern.png"
  8.         autoplay="true"
  9.         width="640"
  10.         height="360"
  11.         playcount="500">
  12. </video>

To see an example, go here, and then take a peak at the shim code itself.

Read more at:
< Prev   Next >