Why should every app have its own code for playing video?

The way it should work (and it may already) is whenever the browser sees a media file, it should check for a plugin that handles it, next see if it's built into the browser, next see if the OS handles it, then fail. Sort of like CSS: check the most specific first before bubbling up to the more generic.

Then if someone has a new codec -- either a whole new format or a better way of handling an old one -- plug it in to the browser. Eventually that code (or something like it) makes it into the browser. Then into the OS.

I guess the tricky part is when video cards arrive that support it in hardware before support has trickled down to the OS, which is where Apple says, "Your app doesn't get to access the hardware."