Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#27891 closed enhancement (fixed)

Setting Poster Image does not also set Featured Image for videos

Reported by: pavelevap's profile pavelevap Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.9
Component: Media Keywords: has-patch
Focuses: javascript Cc:

Description

I am probably blind, but there is a checkbox "Show Images" in "Playlist Settings", but I could not find a way how can I add images to my audio and video playlist?

Attachments (3)

27891.diff (15.5 KB) - added by wonderboymusic 11 years ago.
27891.2.diff (4.4 KB) - added by wonderboymusic 11 years ago.
27891.3.diff (4.2 KB) - added by wonderboymusic 11 years ago.

Download all attachments as: .zip

Change History (13)

#1 @pavelevap
11 years ago

OK, after a while :-)

So we have "Poster image" which we can set for any inserted video file. It is only available for one place, it is a part of video shortcode. So, I can create post, upload video and now I have to insert it into post to access Video Details and then set Poster Image? But this Poster Image is related only to current place in editor and not saved anywhere?

Then we have "Featured image" for media files. So I can upload several video files, create Video Playlist and then I have to go to Media Library, find the first video in my Video Playlist and use "Set Featured Image". Then, this image can be seen as a preview of Video Playlist. But it has to be attached to video which is first in this playlist! And finally, this featured image is not used when inserting only one video file. In this case I have to check Video Details modal and set the same image as "Poster Image" even if I set it as "Featured image"?

Really?

So we have for users both "Poster Image" and "Feature image" and they are not the same. I would expect that setting "Featured image" would be helpfull for every video file and "Poster Image" only for video playlists (as a part of shortcode). It would make much more sense, I guess...

#2 @pavelevap
11 years ago

So, suggestions:

1) Enable Video Details modal (also for Images, etc) before inserting it into editor. It is annoying to open modal window once again to set another functions.

2) Change logic of "Poster" and "Featured" images. Or, better, make only ONE image. When it will be set for video file, it can be used automatically for Video Playlist (and of course changed with the help of shortcode).

3) When I set "Poster image" in Video Details modal, I want it to be also saved to video file (now as Featured image) to be able use it in another place (and not set it once again).

#3 @wonderboymusic
11 years ago

  • Component changed from General to Media
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from Show images in playlists? to Setting Poster Image does not also set Featured Image for videos
  • Type changed from defect (bug) to enhancement

Probably isn't ideal - it works this way now because [audio] and [video] can point at external files, so they aren't really bound to attachments themselves.

I can alter the shortcodes to have a new parameter that's an actual attachment ID, and all of this will be autowired like you suggest.

Will investigate in early 4.0 (basically, next week)

#4 @pavelevap
11 years ago

Yes, thank you, it would be much better. It was not the best UX trying to find out how it really works. I think I am experienced user and I was able to make playlist preview after a long investigation, because I did not notice new Featured image box in Media Library.

#5 @wonderboymusic
11 years ago

  • Focuses javascript added
  • Keywords has-patch added

27891.diff is a work in progress for making IDs work for all of the attributes in the [audio] and [video] shortcodes that also take a URL.

This doesn't 100% work when switching between states yet.

#6 @wonderboymusic
11 years ago

  • Milestone changed from Future Release to 4.0

I will make this work, might need a refresh

#7 @wonderboymusic
11 years ago

27891.2.diff uses tae kwon do instead of jiu jitsu to try to set the featured image in the background for a video URL when you set its poster image. Interestingly enough, it also sets the featured image for whatever fallbacks you specified.

Adds a new function: attachment_url_to_postid(), since audio and video shortcodes don't have to point attachments. They can point at external URLs. IF the video is native to your install, and it match the fragment stored in _wp_attached_file, magic happens.

This ticket was mentioned in IRC in #wordpress-dev by wonderboymusic. View the logs.


11 years ago

#9 @wonderboymusic
11 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 29029:

When setting the poster image for a video shortcode, set that image as the featured image for that attachment (if found) in the background. This AJAX functionality could be used for audio as well.

Introduces attachment_url_to_postid() to attempt to turn URLs into post IDs.

Fixes #27891.

#10 @DrewAPicture
11 years ago

In 29037:

Add @see reference for set_post_thumbnail() in the phpDoc for wp_ajax_set_attachment_thumbnail().

See #27891.

Note: See TracTickets for help on using tickets.