What About Video?
After all you've seen here about audio, you'll only need a few pointers to get going on working with video, so I'll cheat and just give you the hints without full code (which would be quite similar to the code you've already seen). As you learned earlier in this article, you'll have to provide separate ways of showing video for HTML5-enabled browsers and for Internet Explorer; thus, you'll have to use deferred binding to select the correct version at compile time.
Working with HTML5, you'd just have to generate something along these lines:
<video src="the_url_for_your_movie" width="320" height="240"/>
Meanwhile, Internet Explorer would require something like this:
<object width="320" height="240" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <param name="URL" value="the_url_for_your_movie"></OBJECT>
The play() method applies in both cases, so your video classes will be just like your audio classes. On the other hand, if you want to go the Flash way, then you can just include a SWF file within your page.