Here's my problem, I'm using shadowbox on my website to display videos in mp4 format. On a computer everything is working fine and i'm glad it works!
On the other hand when i'm on a mobile device (iOs especially) the box appears but not the video.
The links to "call" the shadowbox are using classes and rel
Code:
<a href="../videos/video.mp4" class="shadowboxclass" rel=shadowbox;width=820;height=460;player=flv;><img src="../images/video_image.png" width="210px" height="117px" alt="astral"></a>
I would like to find a bypass for when mobile devices are detected and remove the class and rel so that it will only open the link like this :
Code:
<a href="../videos/video.mp4"><img src="../images/video_image.png" width="210px" height="117px" alt="astral"></a>
and then get playback in the built in video player of iOS.
Here's my shadowbox configuration :
Code:
<script type="text/javascript" src="../shadowbox/shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init({
skipSetup: true,
overlayOpacity: 0.9,
ext: options
});
var options = {
ext: {
img: ['png', 'jpg', 'jpeg', 'gif', 'bmp'],
swf: ['swf'],
flv: ['flv', 'mp4'], // to play the mp4 in the jwplayer
qt: ['dv', 'mov', 'moov', 'movie'],
wmp: ['asf', 'wm', 'wmv'],
qtwmp: ['avi', 'mpg', 'mpeg'],
iframe: ['asp', 'aspx', 'cgi', 'cfm', 'htm', 'html', 'pl', 'php', 'php3', 'php4', 'php5', 'phtml', 'rb', 'rhtml', 'shtml', 'txt', 'vbs', 'mp4']
}
};
window.onload = function () {
Shadowbox.setup("a.shadowboxclass", {});
};
$(document).ready(function () {
$('a.shadowboxclass').live('click', function (e) {
Shadowbox.open(this);
//Stops loading link
e.preventDefault();
});
});
</script>
I have a code that helps me detect mobile devices
Code:
var iphone = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if (iphone) { /* do something here */ };
It works fine but I just don't know how to get this to work in my situation!
Thank you!