I was just upgrading my app to the new videojs version 4.0, but it is now not working for iPad (works on all other browsers as far as I can tell).
The 4.0 skin doesn't appear, and the API appears to not work at all. The video is being used as a background and is controlled by buttons in the app. However, after the upgrade, the video causes all of the buttons to become un-clickable (or un-touchable if you will).
Here's the JS I'm working with.
var $curTime = 0;
var $setPause = "Go";
var $timeOutTime = 1000;
$( '#main' ).on( 'pageshow',function(event){
videojs("HumanBody", {"preload":"metadata","poster":"http://pidcgr.com/lobby/humanbody/vid/poster.png","controls":true}, function(){
console.log("Initialized");
});
var myPlayer = videojs("HumanBody");
myPlayer.ready(function(){
myPlayer.src([
{ type: "video/mp4", src: "http://pidcgr.com/lobby/humanbody/vid/bodyapp.mp4" },
{ type: "video/ogg", src: "http://pidcgr.com/lobby/humanbody/vid/bodyapp.ogv" }
]);
setTimeout(function() {
if($setPause=="Paused") {
myPlayer.pause();
}
else {
myPlayer.play();
}
myPlayer.on('loadedmetadata', function() {
myPlayer.currentTime($curTime.toFixed(1));
});
}, $timeOutTime);
$(".video-nav").click(function() {
myPlayer.pause();
$curTime = myPlayer.currentTime();
$setPause = "Paused";
});
$("a.start-over").click(function() {
myPlayer.pause();
$curTime = 0;
$setPause = "Go";
});
myPlayer.on('pause', function() {
myPlayer.posterImage.show();
});
myPlayer.on('ended', function() {
myPlayer.currentTime(myPlayer.duration()-1+0.99);
myPlayer.pause();
myPlayer.posterImage.hide();
});
myPlayer.on('error', function() {
console.log("Error");
});
$timeOutTime = 500;
});
});
The video tag looks like this:
<video id="HumanBody" class="video-js vjs-default-skin" width="1024" height="748"></video>
Preview the URL here: http://pidcgr.com/lobby/humanbody/