25 Comments

  • @PHILRESCUE you need to encode your videos in OGG format. use FireOGG or FFMPEG to do that. OR for firefox 4.0, you can encode in webM format.

  • @optikalefxx OK, thats what I was assuming, but lets just make this clear for us idiots 🙂 I need to convert my video file to a. .ogg file format, upload it, so the browser will now shoe the .ogg file correct?

    Now, why before adding this ipad code did the firefox play the flash video but won’t now?

  • @PHILRESCUE Close, you need to encode it as OGG, upload the video, change your <video tag to have 2 <source tags inside. The top one being the orignal mp4 source, the next one being the OGG source. That way when firefox fails to play the mp4, it will move on to play the OGG. Doing it this way will allow iPad to still play the mp4.

  • @optikalefxx OK, but why did the original code stop the flash from playing. Did I right the code wrong? The original video I had is still there as a flash.

  • @PHILRESCUE Yea, if you did it correctly then the flash would still play. Test your document.write(“”) to make sure your detection and IF statement is correct.

  • @optikalefxx I’m plus member on VIMEO, but i dont redirect users to vimeo to watch my videos, i need to embed html5 on website and i dont know how can i make it, can you help me?

  • @estelalim vimeo gives you an Iframe embed code. Use that. It will be html5 on ipad and iphone, and flash for others.

    Thats the best you can do – you could steal the raw mp4 file, but they can come after you for that.

  • hey man your video is really good. i’m a little new to this coding world. i’m trying to watch facebook videos on my ipad. how did you bring up the html 5 window on your computer. i’m running mac os 4.3 on my ipad.

  • the user agent string looks very version specific… won’t it stop working with a newer version of ipad, or an update, etc?

  • thank you! i had a client who couldn’t watch my embedded video on his ipad and i know nothing about code but i fixed it within 30 seconds after watching this. you’re like a magical smartdude fairy. thank you!

  • i had a client who couldn’t watch my embedded video on his ipad and i know nothing about code but i fixed it within 30 seconds after watching this. you’re like a magical smartdude fairy. thank you!

  • i had a client who couldn’t watch my embedded video on his ipad and i know nothing about code but i fixed it within 30 seconds after watching this. you’re like a magical smartdude fairy. thank you!

  • If you’re doing this on a large site with lots of different javascripts embedded in it, please for your own sake have a programmer look at it and fix the issues with global variables, user agent detection instead of feature detection, and with document.write which is a performance killer.

  • @SeanBlader I agree with most of this, but the general rule of thumb is to use feature detection instead of user agent sniffing. Not the other way around. You don’t want to hinder html5 devices if they can use html5 video just because you only allow iphone and ipad.

  • Awesome! But, does this work with iPad2? Don’t know much about the differences, but don’t want to go to the trouble if there *is* something that would prevent this from working on the iPad2…

Leave a Reply

Your email address will not be published. Required fields are marked *