I want the code to check if a user is on an iOS device, and then, if they are not, hide the HTML input type "Play" button.
So, in my code, I'm sure if my iOS checking is wrong, of the code to hide the "Play" button, or both:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
var iOS = false,
p = navigator.platform;
if( p === 'iPad' || p === 'iPhone' || p === 'iPod' ) {
iOS = true;
}
if (iOS === false) {
$("input").hide();
}
</script>
<script type="text/javascript">
function load() {
var vid = document.getElementById('vid');
vid.addEventListener('ended', function() {
/* alert('video ended'); */
/* vid.load(); */
},false);
}
</script>
<title>NEW ENTRY TEST</title>
</head>
<body>
<body onload="load();">
<video id="vid" src="http://awp.diaart.org/ali/test/movies/testmovie.mov" width="640" height="480" autoplay></video>
<br>
<input type="submit" value="Play" onclick="document.getElementById('vid').play();">
</body>
</body>
</html>
Basically I just want this play button to display, only if the user is on an iOS device.
I know it's not working because the play button still displays on a regular (non-iOS) computer.
Curious to hear anyone's thoughts on this.