Commit 6b0655be by Ernie Park

prevent autoplay on iOS devices (which doesnt work anyway). fixes videos so user…

prevent autoplay on iOS devices (which doesnt work anyway). fixes videos so user can click play and it'll play

--HG--
branch : ernie-static-fix-ios-video
parent 5942c13b
......@@ -198,7 +198,7 @@ function onYouTubePlayerAPIReady() {
}
});
updateytplayerInfoInterval = setInterval(updateHTML5ytplayerInfo, 200);
ajax_videoInterval = setInterval(ajax_video, 5000);
//ajax_videoInterval = setInterval(ajax_video, 5000);
}
// Need this function to call the API ready callback when we switch to a tab with AJAX that has a video
......@@ -209,9 +209,26 @@ function loadHTML5Video() {
}
}
function isiOSDevice(){
var iphone = "iphone";
var ipod = "ipod";
var ipad = "ipad";
var uagent = navigator.userAgent.toLowerCase();
//alert(uagent);
if (uagent.search(ipad) > -1 || uagent.search(iphone) > -1
|| uagent.search(ipod) > -1) {
return true;
}
return false;
}
function onPlayerReady(event) {
// alert("ready");
event.target.playVideo();
//do not want to autoplay on iOS devices since its not enabled
//and leads to confusing behavior for the user
if (!isiOSDevice()) {
event.target.playVideo();
}
}
function onPlayerStateChange(event) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment