Skip to content

Fix video aspect ratio for [godam_video] shortcode #1662

@KMchaudhary

Description

@KMchaudhary

Bug Report

Current Behavior
When rendering a video using the [godam_video] shortcode, the placeholder container does not preserve the video’s original aspect ratio. This causes layout shifts during load and negatively impacts the site’s CLS (Cumulative Layout Shift) score if the shortcode is used anywhere on the page.

Expected behavior/code
The placeholder container should have a predefined aspect ratio so it reserves the correct space before the video loads, preventing layout shifts and maintaining visual stability.

Steps to reproduce the bug

  • On post add [godam_video id="123"] shortcode. (Here, 123 is the video attachment id)
  • View page on frontend. (Open inspector > Network tab > Fast 4G network speed to better simulate the issue)

Possible Solution
Pre-apply video aspect ratio based on video width and height metadata.

Additional context/Screenshots

Screen.Recording.2026-02-23.at.10.43.42.AM.mov

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions