3 Replies - 227 Views - Last Post: 09 July 2013 - 10:15 PM Rate Topic: -----

#1 engineer94111  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-July 13

loading same video but different format for a iPhone and PC

Posted 09 July 2013 - 01:42 PM

I need my web page to be able to tell the difference between a mobile browser and a PC browser. I have a video formatted for a mobile browser and also formatted for a PC/MAC. When the client clicks on the button on my web page I need to be able to tell if he is using his mobile device or his laptop/desktop. I need to send the correct format automatically. Thanks in advance.
Is This A Good Question/Topic? 0
  • +

Replies To: loading same video but different format for a iPhone and PC

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1138
  • View blog
  • Posts: 7,110
  • Joined: 07-September 06

Re: loading same video but different format for a iPhone and PC

Posted 09 July 2013 - 01:50 PM

Well, we don't just hand out code here. So you will need to show a little effort.

However, you can look at the headers being sent in with the page request and determine what browser the user is claiming to be using. That is correct, claiming, because you can easily spoof which browser you are using, and some browsers even let you decide what you want to tell people you are using.

Basically you need to find out what the different browsers claim to be, and change the output of your page based on that (if you want to do it through PHP at lesat).
Was This Post Helpful? 1
  • +
  • -

#3 nandureddy  Icon User is offline

  • D.I.C Head

Reputation: 28
  • View blog
  • Posts: 129
  • Joined: 31-January 11

Re: loading same video but different format for a iPhone and PC

Posted 09 July 2013 - 01:57 PM

You can redirect user to the mobile web page directly.
Check out get_browser in php.
Other way is to find the screen width using Javascript and check if its from mobile device.
Was This Post Helpful? 1
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3490
  • View blog
  • Posts: 10,058
  • Joined: 08-June 10

Re: loading same video but different format for a iPhone and PC

Posted 09 July 2013 - 10:15 PM

View Postnandureddy, on 09 July 2013 - 10:57 PM, said:


Note: get_browser() is only a shortcut for what BetaWar described, examining the HTTP Headers (with the same disadvantages).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1