Skip to content

Supplying an aspect ratio AND the transformation parameter causes poster URLs to fail #1087

Open

Description

@eportis-cloudinary
cloudinary.videoPlayer("succeeds", {
  "cloud_name": "demo",
  "autoplay": false,
  "controls": true,
  "loop": false,
  "muted": false,
  "publicId": "dog",
  "showLogo": true,
  "width": "640",
  "height": "360",
  "aspectRatio": "640:360"
});

builds a poster image with URL https://res.cloudinary.com/demo/_applet_/video_service/elements/upload/ZG9n/poster?tx=ar_640%3A360%2Cc_limit%2Cw_1000&_s=vp (ar_640:360,c_limit,w_1000), which succeeds.

However,

cloudinary.videoPlayer("fails", {
  "cloud_name": "demo",
  "autoplay": false,
  "controls": true,
  "loop": false,
  "muted": false,
  "publicId": "dog",
  "transformation": [
    {
      "quality": "auto"
    }
  ],
  "showLogo": true,
  "width": "640",
  "height": "360",
  "aspectRatio": "640:360"
});

builds a poster image with URL https://res.cloudinary.com/demo/_applet_/video_service/elements/upload/ZG9n/poster?tx=q_auto%2Far_640%3A360%2Fc_limit%2Cw_1000&_s=vp (q_auto/ar_640:360/c_limit,w_1000) which returns x-cld-error: Crop mode scale requires specifying either width or height, because the ar transformation is slash-separated rather than comma-separated from the w_1000, so it becomes an independent scale operation without a width or height.

Test cases: https://codepen.io/editor/eeeps/pen/01a0a214-7f4d-79fb-b92d-0e022f701fac

Activity

  1. tsi commented on Sep 15, 2026

    @tsi
    Collaborator

    Hi @eportis-cloudinary thanks for reporting this.

    I guess this is working as-designed in a way - the transformations field in the player configuration can be passed as both object & array - passing an array is exactly about allowing you to control the transformation-string structure - so every array-component becomes a transformation-component (i.e. delimited with a /)

    In your case, the easy way out, if you want the whole thing to be a single transformation-component is to just pass an object.
    See this fork of your codepen: https://codepen.io/editor/tsi/pen/01a0a49c-49e2-732e-9548-c690b5727821

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions