Skip to content

Custom poster image is regenerated lazily when the public id is a URL #378

@Naybnet

Description

@Naybnet

Context

I eagerly generate a video and an image for its poster. They are then used through their raw URL in the cloudinary player:

const cld = cloudinary.videoPlayer(
  'https://res.cloudinary.com/demo/video/upload/w_260,h_200,c_crop,g_north/sample.mp4',
  {
    posterOptions: {
      publicId:
        'https://res.cloudinary.com/demo/video/upload/a_hflip,w_260,h_200,c_crop,g_north/sample.jpg',
    },
  }
)

Problem

Due to this line (https://github.com/cloudinary/cloudinary-video-player/blob/edge/src/plugins/cloudinary/models/image-source.js#L17), the end suffix of the image is removed. This results in the same image being regenerated lazily which defeats the point of having it done eagerly.

Also it means that the poster for the video will only appear after few seconds which leads to a poor user experience.

This problem occurs solely for images since the constructor of the video source only removes the suffix when the public_id is not a raw url (https://github.com/cloudinary/cloudinary-video-player/blob/edge/src/plugins/cloudinary/models/video-source/video-source.js#L29).

Is this something that could be fixed ?

Cheers,

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