Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumbnail is not changing from the WordPress media #253

Open
pavanpatil1 opened this issue Dec 2, 2022 · 11 comments
Open

Thumbnail is not changing from the WordPress media #253

pavanpatil1 opened this issue Dec 2, 2022 · 11 comments
Assignees
Labels

Comments

@pavanpatil1
Copy link
Contributor

pavanpatil1 commented Dec 2, 2022

While changing the thumbnail from the media, it shows the thumbnail saved but while viewing the media the default thumbnail is visible.

Steps to reproduce:

  1. Upload the media and edit it.
  2. Change the thumbnail video thumbnail and save.
  3. Observe the thumbnail is shown selected but while viewing the media the default thumbnail is visible.

Actual Result: After selecting the thumbnail is not changed.

Expected Result: The user should be able to select and change the thumbnail while editing the media and the thumbnail should be changed as per the selected thumbnail image.

thumnbail.issue.mp4

UPDATE:

Current Behavior
Transcoder with WordPress Media Uploads
Video thumbnail is set based on the featured image uploaded and doesn't depend on the thumbnails generated from transcoding
Ideally, if we are showing the thumbnails after transcoding then those should be shown as featured image

Transcoder with rtMedia Uploads
By default after transcoding featured image is set for the video(which is thumbnail)
Now if we change the thumbnail then the thumbnail is getting updated as expected even if featured image is removed
For rtMedia uploads if featured image is uploaded that doesn't get set as thumbnail as the thumbnails are set from frontend..

Expected Behavior
Transcoder with WordPress Media Uploads
Irrespective of the featured image, the thumbnail should get updated

@pavanpatil1 pavanpatil1 added the bug label Dec 2, 2022
@javmah
Copy link
Contributor

javmah commented Dec 5, 2022

This is a design flaw, if we change and uploaded the selected thumbnail then it removed and replaces the Featured image, As you see buttons are radio buttons, no option for deselecting if the user chooses a custom Featured image then our selection overwrites the user's custom selection. if we make radio buttons into checkboxes then the rtMedia thumbnail will not generate.
Suggestion: leave it as is.

@javmah
Copy link
Contributor

javmah commented Dec 6, 2022

if we change, the End user will lose his option to change the thumbnail image.

javmah added a commit that referenced this issue Dec 7, 2022
#253. Thumbnail is not changing from the WordPress media #253, bugfix, and related code change.
javmah added a commit that referenced this issue Dec 7, 2022
Thumbnail is not changing from the WordPress media  # issue 253
@rtCamp rtCamp deleted a comment from javmah Dec 12, 2022
@Pathan-Amaankhan
Copy link
Member

Pathan-Amaankhan commented Feb 2, 2023

Hello @gagan0123,
For this one, I think that we should re-analyze how things are stored in our DB.

The postmeta table stores the relative path of our images which should probably stored the IDs.
Also, we are not creating a new attachment for the images so, technically we won't be having any ids for them.

Screenshot 2023-02-02 at 2 41 54 PM

The approach which we can use is,

  1. Create a taxonomy for attachments that will have public as false (Images in this taxonomy will be unlisted from the media library).
  2. Add custom-generated video thumbnails under this taxonomy.
  3. Save the ids of video thumbnails in _rt_media_thumbnails.
  4. Now we can display these thumbnails in our edit section & update the _thumbnail_id as user selects the video thumbnail from custom-generated ones.

This way we won't be needing any additional _rt_media_video_thumbnail meta.
+
When the user selects the video thumbnail we can update image in featured image section + when the user selects the feature image from the media library we can uncheck all the radio buttons using js so that the user has an idea of what he/she has selected.

Please let me know if this approach seems feasible.

Also, I tried adding the rtMedia plugin to my site & then adding videos but still was unable to update the feature image from the video thumbnail section.

cc: @aviral-mittal

@dishitpala
Copy link
Member

@Pathan-Amaankhan

I don't think we should create a taxonomy for thumbnails because the relationship between thumbnails and video is one-to-one relation and ideally taxonomy is used when there is a one-to-many relation

If I am not wrong, thumbnails are not attachments here so we can not use them with id.

Can you add a featured image (An attachment in WordPress and not a thumbnail ) to the video and check if it appears as a video thumb in the frontend?

@Pathan-Amaankhan
Copy link
Member

Hello @dishitpala,

I totally agree with you & have already tried adding a featured image. After adding the featured image to video everything goes fine but here is the catch:

  • We want that if the user selects a thumbnail then it should be used as a featured image i.e. as video poster.
  • & as our thumbnails are not having any ids attached to them we cannot use them as featured images.
  • So, if we want our thumbnails to act as a featured image, we have to add our thumbnails as WordPress attachments.
  • This way we will be having ids through which we can add featured images but our gallery will be flooded with thumbnail images (As by default we are generating 5 thumbnails for each video).
  • So, to prevent the overflooding of our Gallery, We can add a taxonomy & add all the thumbnails to that taxonomy then, we can hide images under that taxonomy from gallery.

So, here taxonomy that we will be adding will have no relationship with our video's attachments. It will be used just to hide our thumbnails in gallery.

cc: @joelabreo227 @gagan0123

@Pathan-Amaankhan
Copy link
Member

Screenshot 2023-02-14 at 3 40 47 PM

@dishitpala
Copy link
Member

@Pathan-Amaankhan Earlier this functionality was working or from the beginning, it not working?

@Pathan-Amaankhan
Copy link
Member

@dishitpala

Yes, I tried this one on a dummy site & it is not working.

The above S.S. is from https://easydash.rtcamp.com/sites/details?siteName=amaan-transcoder.rt.gw.

Please have a look once.

@aviral-mittal
Copy link

@Souptik2001 Can you please look into this

@aviral-mittal
Copy link

@pavanpatil1 Did this issue get resolved once the server issue of transcoding was resolved?

@pavanpatil1
Copy link
Contributor Author

@aviral-mittal, No this issue is still reproducible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants