cloudinary / cloudinary/cloudinary-video-player

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

Open
#1,087 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
94
Forks
31
Avg merge
4d 16h
Merged PRs (30d)
3

Description

```js
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,

```js
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.