I thought I had blogged about Opera adding support for HTML 5 <audio> and <video> tags which replace the very messy <embed> situation we have now (which is one of the big reasons that embedding video in a web page is mostly done with Flash at the moment.) But I can't find it, so I guess it was one of those many things I almost blogged about but never actually got around to posting. Anyway, yesterday WebKit annouced support as well (WebKit is the rendering engine at the heart of Apple's Safari browser, as well as the open source KHTML - from which Safari was born - plus Nokia's mobile browser and now Google's mobile browser in their new Android mobile OS platform.) And there is some really straightforward javascriptable capabilities:
<script>
function playPause() {
     var myVideo = document.getElementsByTagName('video')[0];
     if (myVideo.paused)
          myVideo.play();
     else
          myVideo.pause();
}
</script>
<input type=button onclick="playPause()" value="Play/Pause"/>


Nice. I've tried playing around with scripting the embedded quicktime player, and it's a real pain. This seems much better. I've been wondering for a while why Apple has let Flash get such a lead here. I think a lot of developers would rather an HTML / javascript solution, but you basically are forced to use Flash now because it just works.
- jim 11-13-2007 4:24 pm

That is great, I hate the clunky embed. Does it work for a Flash video, because that part I like. Quicktime crashes IE a lot.
- L.M. 11-13-2007 7:46 pm


I don't think it will work for flash, but I'm not 100% sure. In any case, it's unclear when/if/how IE will support these media tags so it might all be beside the point in terms of easing cross browser issues.
- jim 11-13-2007 8:06 pm





add a comment to this page:

Your post will be captioned "posted by anonymous,"
or you may enter a guest username below:


Line breaks work. HTML tags will be stripped.