Skip to content

WS-2916: Enable Toucan fake fullscreen support on iOS - #14260

Open
HarveyPeachey wants to merge 9 commits into
latestfrom
WS-2916-toucan-fake-fullscreen
Open

WS-2916: Enable Toucan fake fullscreen support on iOS#14260
HarveyPeachey wants to merge 9 commits into
latestfrom
WS-2916-toucan-fake-fullscreen

Conversation

@HarveyPeachey

@HarveyPeachey HarveyPeachey commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Resolves JIRA: WS-2916

Summary

Enables Toucan fake fullscreen support on iOS devices. This PR implements fake fullscreen functionality that works on iOS platforms, which don't support true fullscreen due to browser limitations. The changes include proper styling, z-index management, and player re-initialization handling to ensure the fake fullscreen experience is seamless for iOS users.

Code changes

  • Enable Toucan fake fullscreen handling on iOS
  • Fix iOS fake fullscreen closing immediately due to player reinitialising
  • Fix visual regression: give fake-fullscreen wrapper div proper layout sizing
  • Update integration snapshots for fake fullscreen wrapper div
  • Adjust z-index of different components and move fake fullscreen styling to shared location
  • Add opt-out option for fake fullscreen functionality
  • Rename fake fullscreen boolean for consistency

Testing

All of the below should be double checked:

  • Integration snapshots updated to reflect new fake fullscreen wrapper div
  • Tested on iOS devices to ensure fake fullscreen opens and closes correctly
  • Verified z-index layering doesn't interfere with other video components
  • Tested player re-initialization doesn't cause immediate closure of fake fullscreen

Useful Links

HarveyPeachey and others added 3 commits July 24, 2026 12:44
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… [copilot]

The inner div wrapping the player content needs flex/height properties so it fills the figure's aspect-ratio constraint for both portrait and landscape orientations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ilot]

buildConfig() was called directly in MediaLoader's render body, producing a
new playerConfig object identity on every render. Entering/exiting fake
fullscreen updates isFakeFullscreenActive state, re-rendering MediaLoader,
which caused MediaContainer's effect to see a changed playerConfig
reference and tear down/recreate the Bump player mid-playback -
immediately closing the freshly-entered iOS fake fullscreen.

Memoise config via useMemo keyed on its real inputs so its identity is
stable across re-renders that don't actually change the player
configuration. Moved the memoised computation ahead of the isLite early
return to keep hook ordering valid.

Added a regression test that exercises real React state (rather than the
mocked no-op setState used elsewhere in this file) to confirm requirejs/
Bump.player/load are only invoked once even after a fake fullscreen state
change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@HarveyPeachey HarveyPeachey self-assigned this Jul 27, 2026
HarveyPeachey and others added 2 commits July 28, 2026 09:34
Copilot AI review requested due to automatic review settings July 28, 2026 08:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables “fake fullscreen” handling for Bump/Toucan video playback on iOS by making MediaLoader manage fullscreen enter/exit events, applying global page classes/styles, and avoiding player re-initialisation during fullscreen state changes.

Changes:

  • Added fake-fullscreen support to MediaLoader (event bindings, page class toggling, fullscreen wrapper/layer, and memoised config to prevent mid-playback teardown).
  • Removed Curation’s fake-fullscreen consent-banner z-index callbacks (previously injected via eventMapping).
  • Updated/regen’d unit tests and many integration snapshots to reflect new markup and analytics/url expectations.

Reviewed changes

Copilot reviewed 62 out of 62 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/app/components/MediaLoader/index.tsx Implements fake fullscreen support (styles + event handling) and memoises player config to avoid reinit during fullscreen toggles.
src/app/components/MediaLoader/index.test.tsx Adds unit tests covering fake fullscreen class toggling, event composition, audio exclusions, and “no reinitialise on fullscreen state change”.
src/app/components/MediaLoader/index.styles.ts Adds a wrapper style used to isolate the player layer during fake fullscreen.
src/app/components/Curation/index.tsx Removes consent-banner z-index hack callbacks previously wired into MediaLoader via eventMapping.
ws-nextjs-app/integration/pages/topicPage/pidgin/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/storyPage/mundo/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/storyPage/mundo/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (Chartbeat domain + localhost/IP URLs).
ws-nextjs-app/integration/pages/storyPage/kyrgyz/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/storyPage/kyrgyz/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (Chartbeat domain + localhost/IP URLs).
ws-nextjs-app/integration/pages/storyPage/hausa/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/storyPage/hausa/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (Chartbeat domain + localhost/IP URLs).
ws-nextjs-app/integration/pages/podcastPage/portugueseEpisode/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/podcastPage/portugueseBrand/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/photoGalleryPage/thai/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/photoGalleryPage/thai/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (Chartbeat domain + localhost/IP URLs).
ws-nextjs-app/integration/pages/photoGalleryPage/mundo/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/photoGalleryPage/mundo/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (Chartbeat domain + localhost/IP URLs).
ws-nextjs-app/integration/pages/onDemandTVPage/pashtoBrand/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/onDemandTVPage/pashto.expired/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/onDemandTVPage/hausa/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/onDemandAudioPage/pashtoBrand/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/onDemandAudioPage/pashto/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/onDemandAudioPage/pashto.expired/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/onDemandAudioPage/indonesia/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/onDemandAudioPage/indonesia.expired/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/onDemandAudioPage/gahuza.expired/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/mostReadPage/pidgin/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/mediaAssetPage/pidgin/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/mediaAssetPage/pidgin/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (Chartbeat domain + localhost/IP URLs).
ws-nextjs-app/integration/pages/mediaAssetPage/persian/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/mediaAssetPage/persian/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (Chartbeat domain + localhost/IP URLs).
ws-nextjs-app/integration/pages/mediaAssetPage/arabicTC2/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/mediaArticlePage/pidgin/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/mediaArticlePage/pidgin/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (Chartbeat domain + localhost/IP URLs).
ws-nextjs-app/integration/pages/liveRadio/kyrgyz/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/liveRadio/korean/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/liveRadio/gahuza/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/live/serbian/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (localhost/IP URLs).
ws-nextjs-app/integration/pages/live/pidgin/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer.
ws-nextjs-app/integration/pages/homePage/serbianLat/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/homePage/serbianCyr/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/homePage/kyrgyz/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/homePage/hindi/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/homePage/arabic/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/av-embeds/russian/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer.
ws-nextjs-app/integration/pages/articles/scotland/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/scotland/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/portuguese/snapshots/amp.test.ts.snap Updates AMP snapshot URLs (localhost/IP).
ws-nextjs-app/integration/pages/articles/pidginEmbedImages/snapshots/canonical.test.ts.snap Updates embedded image URL expectation.
ws-nextjs-app/integration/pages/articles/pidginEmbedImages/snapshots/amp.test.ts.snap Updates AMP embedded image URL expectation.
ws-nextjs-app/integration/pages/articles/pidginEmbedHtml/snapshots/amp.test.ts.snap Updates AMP embed HTML snapshot (aria-label + localhost/IP URL).
ws-nextjs-app/integration/pages/articles/persianMediaPlayer/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer plus analytics/url expectations.
ws-nextjs-app/integration/pages/articles/persianMediaPlayer/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/persian/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/persian/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/news/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/news/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/hausa/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/hausa/snapshots/amp.test.ts.snap Updates AMP integration snapshot expectations (localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/gahuzaLiteSite/snapshots/lite.test.ts.snap Updates lite snapshot URL (localhost/IP).
ws-nextjs-app/integration/pages/articles/gahuza/snapshots/canonical.test.ts.snap Updates integration snapshot expectations (analytics + localhost/IP URLs).
ws-nextjs-app/integration/pages/articles/afrique/snapshots/canonical.test.ts.snap Updates snapshot markup for media loader wrapper/layer.

Comment on lines +463 to +466
{shouldHandleFakeFullscreen && (
<Helmet>
<style type="text/css">{fakeFullscreenStyles}</style>
</Helmet>
Comment on lines +410 to +420
const setFakeFullscreenPageState = (isActive: boolean) => {
if (!onClient()) return;

document.documentElement.classList.toggle(
PLAYER_FULLSCREEN_CLASS,
isActive,
);
document.body.classList.toggle(PLAYER_FULLSCREEN_CLASS, isActive);
hasActivatedFakeFullscreenRef.current = isActive;
setIsFakeFullscreenActive(isActive);
};
Comment on lines 11 to 13
{
"s": "598343",
"s": "598342",
},
Comment on lines 238 to 242
{
"sizes": null,
"url": "http://localhost:7081/mundo/images/icons/icon-192x192.png",
"url": "http://192.168.1.106:7081/mundo/images/icons/icon-192x192.png",
}
`;
Comment on lines 94 to 98
"authors": "Redacción ",
"contentType": "STY",
"domain": "test.bbc.co.uk",
"domain": "mundo.bbc.co.uk",
"sections": "Mundo, Mundo - STY",
"title": "Brexit: qué cambiará para visitar, trabajar y estudiar en Reino Unido tras la salida del país de la Unión Europea",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 68 out of 68 changed files in this pull request and generated no new comments.

Suppressed comments (3)

ws-nextjs-app/integration/pages/storyPage/mundo/snapshots/amp.test.ts.snap:212

  • These integration snapshots include machine/environment-specific values (e.g. LAN host http://192.168.1.106:7081). IntegrationTestEnvironment hardcodes http://localhost:7081 (ws-nextjs-app/integration/IntegrationTestEnvironment.ts:47), so committing a local IP will make snapshots fail for other developers/CI. The same snapshot set also switches ATI destination IDs from TEST to live (e.g. 598343 -> 598342), which per getExpectedAtiDestination corresponds to applicationEnv === 'live' (src/app/components/ATIAnalytics/helpers/getExpectedAtiDestination.ts:16-36). Please re-record snapshots in the standard test environment so host + analytics IDs are deterministic.
    src/app/legacy/containers/ConsentBanner/Banner/index.canonical.jsx:23
  • Hiding the consent banner via z-index: -1 can leave it in the focus order / accessibility tree while fake fullscreen is active. Prefer removing it from rendering (e.g. display: none) so keyboard/screen-reader users can’t interact with it behind the fullscreen layer.
  body.${PLAYER_FULLSCREEN_CLASS} & {
    z-index: -1;
  }

src/app/components/Account/AccountSignInModal/index.styles.tsx:32

  • Using zIndex: -1 to “hide” the sign-in modal during fake fullscreen can leave it focusable / exposed to assistive tech. Prefer removing it from rendering (e.g. display: 'none') while body is in simorgh-player-fullscreen.
    [`body.${PLAYER_FULLSCREEN_CLASS} &`]: {
      zIndex: -1,
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants