Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » [solved] Not switching for Android if...
[solved] Not switching for Android if Samsung s4 or HTC one
[solved] Not switching for Android if Samsung s4 or HTC one
Hi,
I am trying to show a module which contains a flash movie on Desktop but an html5 version of the movie on all mobile, tablet devices.
The issue is, it works fine for iphone etc however, when viewing on the newer Samsung and HTC phones / tablets, the switch is not being made. Those still try and show the Flash movie.
Here is my code (Please notice there is also a replay module)
if (!isset($_GET["replay"])) {
session_start();
$instance_name = "shown_module_1"; /* use a different name for each module that you want to show only once */
if (!isset($_SESSION[$instance_name]) ||
$_SESSION[$instance_name] == false) {
$_SESSION[$instance_name] = true;
// detect iphones, ipods and ipads. You can stack several browsers together like this:
if ( $core_genius->check( "browsertype == iphone, ipod, ipad, android" ) ) return 97;
//by default return flash version
return 132;
}
return 210;/* the module you want to display on the 2nd, 3rd... showing */
}
else {
// detect iphones, ipods and ipads. You can stack several browsers together like this:
if ( $core_genius->check( "browser_type == iphone, ipod, ipad, android" ) ) return 97;
//by default return flash version
return 132;}
Any help would be appreciated.
Re: [solved] Not switching for Android if Samsung s4 or HTC one
Hi,
can you please help me to isolate why this is going on? At the top of your MetaMod PHP code can you please put the following:
echo "User agent: " . $_SERVER['HTTP_USER_AGENT'] . '<br>';
Then can you view this on the Samsung s4 and HTC phones and post the results of the user agent string? Then I can check that in the MetaMod browser detection code and see what's going on there.
Thanks,
Stephen
Re: [solved] Not switching for Android if Samsung s4 or HTC one
From the S4:
Regular browser -
User agent: Mozilla/5.0 (Linux; Android 4.4.2; en-us; SAMSUNG SPH-L720 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36
Chrome Browser on S4
User agent: Mozilla/5.0 (Linux; Android 4.4.2; SPH-L720 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Mobile Safari/537.36
Here are the screen caps
Thanks for your help,
Bill
Re: [solved] Not switching for Android if Samsung s4 or HTC one
- Index
- » MetaMod
- » MetaMod General Support
- » [solved] Not switching for Android if...
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5965
- Posts this week:
- 3
- User Info:
- Total Users:
- 8012
- Newest User:
- grant1ab
- Members Online:
- 0
- Guests Online:
- 169
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked