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 */