MOBILE-4081 h5p: Fix full screen in Android

main
Dani Palou 2022-12-01 10:25:36 +01:00
parent f0823b59a2
commit 5b4ac6b6ec
2 changed files with 10 additions and 6 deletions

View File

@ -37,13 +37,16 @@ if (document.documentElement.requestFullScreen) {
H5P.fullScreenBrowserPrefix = '';
}
else if (document.documentElement.webkitRequestFullScreen) {
H5P.safariBrowser = navigator.userAgent.match(/version\/([.\d]+)/i);
H5P.safariBrowser = (H5P.safariBrowser === null ? 0 : parseInt(H5P.safariBrowser[1]));
// Do not allow fullscreen for safari < 7.
if (H5P.safariBrowser === 0 || H5P.safariBrowser > 6) {
// This code has been changed to allow full screen in Moodle app.
H5P.fullScreenBrowserPrefix = 'webkit';
}
H5P.safariBrowser = 0;
// H5P.safariBrowser = navigator.userAgent.match(/version\/([.\d]+)/i);
// H5P.safariBrowser = (H5P.safariBrowser === null ? 0 : parseInt(H5P.safariBrowser[1]));
// // Do not allow fullscreen for safari < 7.
// if (H5P.safariBrowser === 0 || H5P.safariBrowser > 6) {
// H5P.fullScreenBrowserPrefix = 'webkit';
// }
}
else if (document.documentElement.mozRequestFullScreen) {
H5P.fullScreenBrowserPrefix = 'moz';

View File

@ -4,3 +4,4 @@ H5P library
Changes:
1. The h5p.js file has been modified to make fullscreen work in the Moodle app. In line 34, the code inside the condition document.documentElement.webkitRequestFullScreen has changed, the original code has been commented.
2. The h5p.js file has been modified to simulate a fake full screen in iOS. The H5P file now sends post messages to the app, and also listens to messages sent by the app to enter/exit full screen.