Skip to content
Open
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
13 changes: 13 additions & 0 deletions astro-cloudinary/src/components/CldVideoPlayer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ const cloudinaryConfig = getCloudinaryConfig(config);
const playerOptions = getVideoPlayerOptions(props, cloudinaryConfig);
const { publicId } = playerOptions;

if (playerOptions.transformation && Array.isArray(playerOptions.transformation)) {
const hasStreamingProfileAuto = playerOptions.transformation.some(
(transform: any) => transform.streaming_profile === 'auto'
);

if (hasStreamingProfileAuto) {
// Remove any quality parameter from transformations when streaming_profile is 'auto'
playerOptions.transformation = playerOptions.transformation.filter(
(transform: any) => !('quality' in transform)
);
}
}

if ( typeof publicId === 'undefined' ) {
throw new Error('[CldVideoPlayer] Public ID or Cloudinary URL required - please specify a src prop.');
}
Expand Down