Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/plugins/cloudinary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class CloudinaryContext {
{ hasUserPosterOptions: hasUserPosterOptions || null }
);

options.queryParams = Object.assign(options.queryParams || {}, options.allowUsageReport ? { _s: `vp-${VERSION}` } : {});
options.queryParams = Object.assign(options.queryParams || {}, options.allowUsageReport ? { _s: 'vp' } : {});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

because we report the version in the internal analytics call?
why do we remove the version?


if (options.sourceTypes.indexOf('audio') > -1) {
builtSrc = new AudioSource(publicId, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ class VideoSource extends BaseSource {

options.cloudinaryConfig = options.cloudinaryConfig || this.cloudinaryConfig();
options.resource_type = this.resourceType() || options.resource_type;
options.queryParams = this.queryParams();

if (!isRawUrl(publicId)) {
options.queryParams = this.queryParams();
}

if (publicId === true) {
const urlPrefix = getCloudinaryUrlPrefix(options.cloudinaryConfig);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/fetch-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const fetchConfig = async (options) => {

const cloudinaryConfig = getCloudinaryConfigFromOptions(options);
const urlPrefix = getCloudinaryUrlPrefix(cloudinaryConfig) + '/_applet_/video_service';
const queryParams = allowUsageReport ? { _s: `vp-${VERSION}` } : null;
const queryParams = allowUsageReport ? { _s: 'vp' } : null;

let configUrl;
if (profile) {
Expand Down
18 changes: 18 additions & 0 deletions test/unit/videoSource.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,24 @@ describe('test hasCodec method', () => {
expect(posterUrl).toContain('/video/upload/');
});

it('does not append source queryParams to raw absolute poster URLs', () => {
const posterHref = 'https://cdn.example.com/assets/poster.jpg';
const source = new VideoSource('sea_turtle', {
cloudinaryConfig: cld,
queryParams: { _s: 'vp' },
poster: posterHref
});
expect(source.poster().url()).toBe(posterHref);
});

it('appends stable _s to Cloudinary-built poster URLs', () => {
const source = new VideoSource('sea_turtle', {
cloudinaryConfig: cld,
queryParams: { _s: 'vp' }
});
expect(source.poster().url()).toContain('_s=vp');
});

it('should use configured resourceType for seek thumbnails', () => {
const source = new VideoSource('sample', {
cloudinaryConfig: cld,
Expand Down
Loading