trigger setSizes in VideoPlayer on Ox.Fullscreen, add Ox.Fullscreen.available to check if fullscreen support is present(i.e. in iframe)

This commit is contained in:
j 2012-12-20 18:30:48 +00:00
parent 251fe64350
commit b20d6a6e59
2 changed files with 12 additions and 1 deletions

View file

@ -85,6 +85,10 @@ Ox.Fullscreen = (function() {
});
}
that.available = document.fullscreenEnabled
|| document.webkitFullscreenEnabled
|| document.mozFullScreenEnabled || false;
that.bind = function(event, handler) {
bind(event, handler);
};

View file

@ -219,6 +219,13 @@ Ox.VideoPlayer = function(options, self) {
}
});
Ox.Fullscreen.bind('change', function() {
//FIXME: is change fired before window size is updated to fullscreen?
self.options.fullscreen && setTimeout(function() {
setSizes(true);
}, 250);
});
if (Ox.isEmpty(self.options.annotations)) {
self.options.annotations = self.options.subtitles;
}