From bd1f25448bfd9662a4e25acce5c31e1bdda3dec6 Mon Sep 17 00:00:00 2001 From: Frank Ronny Larsen Date: Thu, 18 Jul 2013 15:58:52 +0200 Subject: [PATCH] OPPG-473: Safari now use fake fullscreen. Which is better than real fullscreen IMNSVHO... --- js/h5p.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index 20dbcf1..876c975 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -16,7 +16,18 @@ H5P.init = function () { H5P.fullScreenBrowserPrefix = ''; } else if (document.documentElement.webkitRequestFullScreen && navigator.userAgent.indexOf('Android') === -1) { // Skip Android - H5P.fullScreenBrowserPrefix = 'webkit'; + // Safari has stopped working as of v6.0.3. (Specifying keyboard input + // makes webkitRequestFullScreen silently fail.) The following code + // assumes that the Safari developers figure out how to properly handle + // their own extension before reaching version 6.0.10. Until then, we + // treat Safari as an old IE. (Please note: Just looking for Safari in + // the UA string will also match Chrome.) + if (navigator.userAgent.match(/Version\/6\.0\.[3-9].*Safari/)) { + H5P.fullScreenBrowserPrefix = undefined; + } + else { + H5P.fullScreenBrowserPrefix = 'webkit'; + } } else if (document.documentElement.mozRequestFullScreen) { H5P.fullScreenBrowserPrefix = 'moz'; @@ -197,7 +208,7 @@ H5P.libraryFromString = function (library) { /** * Get the path to the library - * + * * @param {string} machineName The machine name of the library * @returns {string} The full path to the library */