Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3306 +/- ##
============================================
+ Coverage 61.85% 66.35% +4.50%
+ Complexity 3660 2670 -990
============================================
Files 411 240 -171
Lines 15867 11970 -3897
============================================
- Hits 9814 7943 -1871
+ Misses 6053 4027 -2026
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When merged in, will set the
H5P.externalEmbedto fix detection of H5P.fullscreenSupported which then fixes broken fullscreen button behavior on iPhones.Note
I never managed to get Edlib running locally, so this is experimental! I am not sure if
window.H5Pwill already be set when trying to call it. That you may want to check. Setting the value should be done before the content is initiated.Background
H5P integrations usually use H5P core to render the non-embed iframe contents:
To reproduce the underlying issue
Edlib
Visit https://hub.h5p.ndla.no/content/01kcp5fawcfbc2g9j5e39vp7t9 showing H5P.EscapeRoom content
a) On any system but an iPhone, the content will show a fullscreen button in the upper right-hand corner. ✅
b) On an iPhone, the content will not show a fullscreen button in the upper right-hand corner. ❌
WordPress (for comparison)
Visit https://www.olivertacke.de/labs/2024/07/23/ndla-brings-you-yet-another-h5p-content-type-escape-room/
On any system, including an iPhone, the content will show a fullscreen button in the upper right-hand corner. ✅
Background
H5P.init(), all iframes that have not yet been initialized will filled with content(https://github.com/h5p/h5p-php-library/blob/1e21b7a2da4ae9c4f1f9e61f7ae1038f8850fb82/js/h5p.js#L380-L406)
getHeadTags()called in (https://github.com/h5p/h5p-php-library/blob/1e21b7a2da4ae9c4f1f9e61f7ae1038f8850fb82/js/h5p.js#L392),H5P.externalEmbedwill be set tofalseexplicitly (https://github.com/h5p/h5p-php-library/blob/1e21b7a2da4ae9c4f1f9e61f7ae1038f8850fb82/js/h5p.js#L437).That never happens on Edlib.
As a consequence, the computation of the value for
H5P.fullscreenSupportedis impacted (https://github.com/h5p/h5p-php-library/blob/1e21b7a2da4ae9c4f1f9e61f7ae1038f8850fb82/js/h5p.js#L77).This matters on iPhones which do not support
document.fullscreenEnabled(cmp. https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled#browser_compatibility).In that case (if ignoring potential override flags for disabling support deliberately)
H5P.fullscreenSupportedis only determined by!(H5P.isFramed && H5P.externalEmbed !== false)andH5P.externalEmbed !== falseis the crucial condition.If
H5P.externalEmbedis not set tofalseexplicitly when in a non-embedded context, then fullscreen support is supposed to be off, and then iPhones do not show the fullscreen button of content types (e.g. Course Presentation, Interactive Video, GameMap, etc.) as it being displayed depends onH5P.fullscreenSupportedto be true.