Skip to content

WS-1994: Support portrait video on the Live Page#13668

Open
alex-magana wants to merge 30 commits intolatestfrom
WS-1994-support-portrait-video-live-page
Open

WS-1994: Support portrait video on the Live Page#13668
alex-magana wants to merge 30 commits intolatestfrom
WS-1994-support-portrait-video-live-page

Conversation

@alex-magana
Copy link
Contributor

@alex-magana alex-magana commented Jan 30, 2026

Resolves JIRA: WS-1994

Summary

Adopt portrait video on Live Page posts.

Code changes

  • Infer and set the orientation for video content of type, clipMedia, in the SMP player config.
  • Centralise the isPortraitVideo utility so that it's shared between Article Page, Media Article Page and Live Page.
  • Exclude rendering of the media player placeholder for the Live Page.
  • Update types, AresMediaBlock and AresMediaMetadataBlock, to reflect the structure of the payload provided by FABL.

Testing

  1. Visit the sample Live Page assets below.
  2. A Live Page post with a portrait video media should render the player in portrait mode and match the PS experience.
  3. Portrait video experiences on other page types should continue to work as usual.
Sample Live Page Assets

http://localhost.bbc.com:7081/pidgin/live/c7p765ynk9qt?renderer_env=test
http://localhost.bbc.com:7081/mundo/live/c40d0wq5gmj9t?renderer_env=test
Sample Article Page and Media Article Pages Assets
http://localhost.bbc.com:7081/pidgin/articles/c898zn0254xo?renderer_env=live
http://localhost.bbc.com:7081/arabic/articles/c0kg50ezg3xo?renderer_env=live
http://localhost.bbc.com:7081/russian/articles/cvgvyv854x2o?renderer_env=live
http://localhost.bbc.com:7081/portuguese/articles/c50ke1x39k0o?renderer_env=test
http://localhost.bbc.com:7081/portuguese/articles/cn287ylzgwgo?renderer_env=test
http://localhost.bbc.com:7081/arabic/articles/cvyd1xeje3jo?renderer_env=test
http://localhost.bbc.com:7081/arabic/articles/cdk6344q3r6o?renderer_env=test

Useful Links

@alex-magana alex-magana changed the title Ws 1994 support portrait video live page WS-1994: support portrait video live page Jan 30, 2026
@alex-magana alex-magana changed the title WS-1994: support portrait video live page WS-1994: Support portrait video on the Live Page Feb 6, 2026
@alex-magana alex-magana marked this pull request as ready for review February 6, 2026 11:21
duration: string;
kind: string;
guidance: string | null;
orientation: string | null;
Copy link
Contributor

@amoore108 amoore108 Feb 6, 2026

Choose a reason for hiding this comment

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

Could we use the Orientations type here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. This is feasible.
Let me change this to Orientations.

video: (props: { blocks: MediaBlock[] }) => {
const { blocks } = props;
const isPortrait = isPortraitVideo(blocks);
const className = isPortrait ? 'portrait-clip-media' : '';
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering can we use the existing .media-container classname that exists on the figure element, rather than appending portrait-clip-media to it?

We should be able to do something like:

 portraitVideoPlayer: () =>
    css({
      '.media-container': {
        margin: '20px auto 0',
        width: `${pixelsToRem(247)}rem`,
      },
    }),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking a look at these changes, Aaron.

The rationale behind portrait-clip-media is adopted from the approach used
in the MediaArticlePage. I'll change the styling to media-container and see how it plays out.

return ORIENTATION_MAPPING.ORIGINAL;
}

const transformedConfig = transformOrientationConfigToUpperCase(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const transformedConfig = transformOrientationConfigToUpperCase(
const transformedConfig = mediaOrientationConfig.map(setting => setting.toUpperCase())

I think this doesn't need to be in it's own function. I think it's pretty readable as it is.

Comment on lines +24 to +29
const orientationType =
transformedConfig.find(orientationConfig =>
Object.keys(ORIENTATION_MAPPING).includes(
orientationConfig.toUpperCase(),
),
) ?? 'ORIGINAL';
Copy link
Contributor

Choose a reason for hiding this comment

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

Would just using transformedConfig.find(orientationConfig => orientationConfig in ORIENTATION_MAPPING) ?? 'ORIGINAL' work here instead of using Object.keys()?
Also not sure why orientationConfig needs to be made into uppercase again on line 27

portraitVideoPlayer: () =>
css({
'.media-container': {
margin: '20px auto 0',
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be using pixelsToRem(20)?

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.

5 participants