Declarative Syntax for Widgets

Jeff Watkins is updating his MVC library, Coherent, and is wondering if he should add declarative syntax for child widgets. Currently, you have to write a lot of init() setup code, but instead he would like to do something like: PLAIN TEXT JAVASCR...

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

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:

HTML:
  1.  
  2. <script type="text/javascript" src="swfobject/src/swfobject.js"></script>
  3. <script type="text/javascript" src="html5_video.js"></script>
  4.  
  5. <video src="http://onair.adobe.com.edgesuite.net/onair/raulph_hauwert_papervision3d.flv"
  6.         controls
  7.         poster="testpattern.png"
  8.         autoplay="true"
  9.         width="640"
  10.         height="360"
  11.         playcount="500">
  12. </video>
  13.  

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


Read more at: http://feeds.feedburner.com/~r/ajaxian/~3/299835333/html5-video-tag-implemented-in-flash.
 
< Prev   Next >