Skip to content

Commit e1df5b3

Browse files
committed
JI-1987 Fix inconsistency in fullscreen support
Previously we would not add fullscreen button when H5P .fullscreenSupported is false, but we would attempt to force content on small devices into fullscreen regardless of this flag. This caused inconsistencies. On a side-note forcing the content into fullscreen did work, so the H5P .fullscreenSupported check is probably not valid for all cases, but now it is consistent in IV at least.
1 parent a6ab73f commit e1df5b3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/scripts/interactive-video.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,12 @@ function InteractiveVideo(params, id, contentData) {
505505

506506
// Auto toggle fullscreen on play if on a small device
507507
var isSmallDevice = screen ? Math.min(screen.width, screen.height) <= self.width : true;
508-
if (!self.hasFullScreen && isSmallDevice && self.$container.hasClass('h5p-standalone') && self.$container.hasClass('h5p-minimal')) {
508+
const canPlayInFullScreen = H5P.fullscreenSupported
509+
&& !self.hasFullScreen
510+
&& isSmallDevice
511+
&& self.$container.hasClass('h5p-standalone')
512+
&& self.$container.hasClass('h5p-minimal');
513+
if (canPlayInFullScreen) {
509514
self.toggleFullScreen();
510515
}
511516
self.video.play();

0 commit comments

Comments
 (0)