javascript redirect for iOS, Blackberry, Android and Modern Browsers


Different phones and tablets, Android, PCs, Kindle, Blackberry, etc need different video formats encoded for optimized playback. That’s a given.


How can you easily redirect for iOS and other mobile screens?


It’s hard work getting the right video to the right screen. Not only do you have different video container formats, such as HLS, H.264, MP4; You also have a wide spectrum of widths and heights to consider.

&n Here’s a javascript redirect to send iOS devices to a HLS m3u8, Blackberry to a mpeg4 transcoded for Blackberry, then redirect Android to a embedded HTML5 video page with a WebM fallover and ‘modern browsers’ to a rtmp:// flash embed using H264 MP4 so the video stays relatively protected from download. Customize your links ( document.location ) any way you wish. It’s just a utility knife for device headers :) Oh, and you should use these services on a global CDN and have us do all the transcoding for you. Save some time, and time is a valuable commodity. We’re happy to work as an extension of your IT team to get your video project hosted, searchable, and playable on a wide range of devices!


For your :

<script type="text/javascript">if (navigator.userAgent.indexOf('iPhone') != -1) {         document.location = "";}
if (navigator.userAgent.indexOf('iPad') != -1) {
document.location = "";}
if (navigator.userAgent.indexOf('iPod') != -1) {
document.location = "";}
if (navigator.userAgent.indexOf('Blackberry') != -1) {
document.location = "";}
if (navigator.userAgent.indexOf('Android') != -1) {
document.location = "html5.html";}

OK, so now you have Android phones and tablets, iPads, iPhones, Blackberry’s going either to their own pages or video files that are encoded for them specifically. It happens when your page starts to load.


What do you want to do with everyone else?


We like to send everyone else, which is mostly modern browsers, to a multi bit rate flash embed using H.264 mp4, because then your video is protected from download.


So after we say goodbye to all the phones, tablets, Android, iOS, whatever, we say hello/goodbye to what’s still here:


<!-- all that's left is everything else except what's up there. Let's protect the video from download from the browsing public! -->
<script language="JavaScript">self.location="protected_flash.html";</script>
2 karma points