0
Welcome Guest! Login
0 items Join Now

ROCKETTHEME IS CLOSING ON JUNE 30, 2025. As a thank-you to our community, enjoy 50% off all themes with the promo code THANKYOU before we shut down. Read our Farewell Blog Post for more details.

Serve Different Video Per Browser / Mobile

    • Rich Bean's Avatar
    • Rich Bean
    • Elite Rocketeer
    • Posts: 1194
    • Thanks: 1

    Serve Different Video Per Browser / Mobile

    Posted 14 years 7 months ago
    • Hi Guys,

      Am looking for a way to serve a different video file if the user is on a mobile device / iPhone.

      For example a .flv if they are on a desktop, but .3gp on an iPhone.

      Ultimately I'd like to be able to do this in K2.

      I did see something about including a php statement similar to this:
      <?php
      if(strstr($_SERVER['HTTP_USER_AGENT'],’iPhone’) || strstr($_SERVER['HTTP_USER_AGENT'],’iPod’)) {
      print <<<END
      <embed src=”http://pathtovideo.3gp” width=”XXX” height=”XXX” href=”http://pathtovideo.3gp”>
      END;
      }
      else {
      print <<<END
      *****VIDEO EMBED CODE*****
      END;
      }
      ?>

      But that would only work in the body and not allow me to select the alternate video in K2.

      Hrmmmm.....
    • My Sites:
      Perth Website Design
      Scuba Marketing
      I'm a Henning Stalker!
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: Serve Different Video Per Browser / Mobile

    Posted 14 years 7 months ago
    • Hmm could you use the custom PHP module (mod_php)
      www.fijiwebdesign.com/products/joomla-php-module.html

      Add the code above, then set it as a custom position "customvid" on the K2 page.
      then within the K2 item put {loadposition customvid}

      I havent a clue if it will work, but only way i can think without editing K2's core files or creating a plugin.
      Ad.
    • Kiss my RSS

Time to create page: 0.071 seconds