Shadowbox JS on Mobile devices
-
I’m in the process of converting an existing site to a responsive version in WP 3.51. I’ve installed Shadowbox JS to play videos in a modal window, and it works beautifully in desktop browsers. I’ve run into a small snag: the plugin displays “You must install the Flash browser plugin to view this content” on mobile browsers.
No big deal for iOS devices. Using your suggestion here https://www.ads-software.com/support/topic/plugin-shadowbox-js-is-it-possible-to-disable-shadowbox-for-iphoneipad I added the code to my theme functions.php:
<?php global $is_iphone; if ( $is_iphone ) { add_filter('shadowbox-js', '__return_false'); } ?>
which forces iOS devices to launch the YouTube player. So far so good.
However, when testing on an Android device simulator, I get the same error. I have to admit I’m clueless about Android — does it come with a YouTube app like the iPhone? And/or is there a way to force the browser to play the MP4 version of the video?
I see your little code snippet uses the “$is_iphone” global from WP vars.php. Is there a similar global var for Android? The closest thing I see is “$is_chrome” – wondering what the Useragent is for Droid.
Any assistance you can give is greatly appreciated.
- The topic ‘Shadowbox JS on Mobile devices’ is closed to new replies.