WS-2916: Enable Toucan fake fullscreen support on iOS - #14260
Open
HarveyPeachey wants to merge 8 commits into
Open
WS-2916: Enable Toucan fake fullscreen support on iOS#14260HarveyPeachey wants to merge 8 commits into
HarveyPeachey wants to merge 8 commits into
Conversation
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>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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 viaeventMapping). - 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", |
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.
Resolves JIRA:
Summary
Code changes
Testing
Useful Links