19 July 2008 @ 21:49Making video accessible to iPhones
The problem I was looking to solve was that of iPhones and iPod touches not being able to play most of the videos on my site, that is videos that utilized the flash video player. My thought to fix this was to create two separate divs that were toggled between based on the User Agent.
Next I inserted the “onload” event to the <body> tag:
Finally, I created two separate divs — one with my usual flash video player with id=”flashvid” and style=”display:block” and the second with embedded quicktime video, id=”iphonevid” and style=”display:none” .
See it in action on this post for the Watchmen trailer.
And if you don’t have an iPhone to test this with, you can use Safari. With the Develop menu enabled, the User Agent can easily be changed.