From d8f30c1d0fd9dc6e124a41f2302c21ad2fddb4ee Mon Sep 17 00:00:00 2001 From: edlib-oddarne Date: Tue, 2 Jun 2026 10:11:32 +0200 Subject: [PATCH] Hide fullscreen toggles when `disableFullscreen` option is enabled in Brightcove player --- .../contentauthor/public/js/videos/brightcove.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sourcecode/apis/contentauthor/public/js/videos/brightcove.js b/sourcecode/apis/contentauthor/public/js/videos/brightcove.js index c405d3acf6..f81fa8e89d 100644 --- a/sourcecode/apis/contentauthor/public/js/videos/brightcove.js +++ b/sourcecode/apis/contentauthor/public/js/videos/brightcove.js @@ -55,6 +55,17 @@ H5P.VideoBrightcove = (function ($) { if( options.controls !== true){ player.bigPlayButton.hide(); } + if (options.disableFullscreen === true) { + if (player.controlBar && player.controlBar.fullscreenToggle) { + player.controlBar.fullscreenToggle.hide(); + } + player.on('play', function () { + // Some players re-enable fullscreen on play or have it in a state that needs re-hiding + if (player.controlBar && player.controlBar.fullscreenToggle) { + player.controlBar.fullscreenToggle.hide(); + } + }); + } player.on('loadedmetadata', function () { self.trigger('loaded'); self.playerTracks = filterTracks(player); @@ -82,6 +93,9 @@ H5P.VideoBrightcove = (function ($) { self.appendTo = function ($container) { $container.addClass('h5p-brightcove').append($wrapper); + if (options.disableFullscreen === true) { + $container.addClass('h5p-disable-fullscreen'); + } create(); };