From b20d6a6e592a6bb26c1e4651268bfd08f9c128b0 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 20 Dec 2012 18:30:48 +0000 Subject: [PATCH] trigger setSizes in VideoPlayer on Ox.Fullscreen, add Ox.Fullscreen.available to check if fullscreen support is present(i.e. in iframe) --- source/Ox.UI/js/Core/Fullscreen.js | 6 +++++- source/Ox.UI/js/Video/VideoPlayer.js | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/Core/Fullscreen.js b/source/Ox.UI/js/Core/Fullscreen.js index def13612..d42ee5a7 100644 --- a/source/Ox.UI/js/Core/Fullscreen.js +++ b/source/Ox.UI/js/Core/Fullscreen.js @@ -85,6 +85,10 @@ Ox.Fullscreen = (function() { }); } + that.available = document.fullscreenEnabled + || document.webkitFullscreenEnabled + || document.mozFullScreenEnabled || false; + that.bind = function(event, handler) { bind(event, handler); }; @@ -136,4 +140,4 @@ Ox.Fullscreen = (function() { return that; -}()); \ No newline at end of file +}()); diff --git a/source/Ox.UI/js/Video/VideoPlayer.js b/source/Ox.UI/js/Video/VideoPlayer.js index a5d21d47..ce48edcd 100644 --- a/source/Ox.UI/js/Video/VideoPlayer.js +++ b/source/Ox.UI/js/Video/VideoPlayer.js @@ -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; }