kylegilman / video-embed-thumbnail-generator

A WordPress plugin that generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
http://wordpress.org/plugins/video-embed-thumbnail-generator/
GNU General Public License v2.0
48 stars 27 forks source link

Request to add video thumbnail image ID to API or some other method that schema plugins can reference #528

Open mykkal opened 1 year ago

mykkal commented 1 year ago

Hi Kyle, I wanted to make a feature request that would give the project even more utlity especially on the pro side of the plugin. I use WPSSO to insert JSON schema into our webpages. It is able to parse the code and add rich snippets and so on... which help us a lot in SERP. The thing is we have to add the video thumbnail url manually to WPSSO (or any other schema plugin).

This could be solved easily if there were a way to identify the thumbnail videopack assigned to the video. I have two suggestions from the plugin author. I believe he could adjust his plugin to pull the video thumbnail from either of these methods:

JS Morisset wrote:

If WPSSO could determine the attachment ID of the video URL, then it could get the upload date from WordPress, and yes, possibly the preview image as well - but the HTML markup created on your site does not provide the attachment ID, so all WPSSO can get is the video URL, not the video attachment ID or video file path.

FYI, the easiest solution would be to add the WP attachment ID to the video URL, like:

https://.../video.mp4?attachment_id=123

I think the second method probably is the least useable in my case because the videos are automatically inserted as the original filename.

The reason i'm asking for this is because google no longer likes to index videos without proper schema information which includes the video url. You're already assigning a thumbnail so it'd be great for schema plugins to be able to reference that.

kylegilman commented 1 year ago

I already provide an option for inline schema, but I didn't know about JSON schema. Would it be useful if I just had Videopack generate a JSON schema for the video objects on the page, or would that interfere with information generated by WPSSO?

mykkal commented 1 year ago

I sent your reply to the plugin author. I'm waiting for him to reply back.

mykkal commented 1 year ago

Hi Kyle!

I got an awesome reply to your last message from the WPSSO plugin maker. If it can be resolved I think your plugin will be the most modern video plugin on the market.

`What they call "inline schema" is probably microdata markup, which is deprecated. We actually have an add-on to remove it (see https://wordpress.org/plugins/wpsso-strip-schema-microdata/).

Adding a block of Schema markup as a JSON script does not add value unless it is connected to the @graph, which connects all blocks of Schema markup.

Adding video markup is two parts, 1) the detection of the video markup, 2) the fetching of video details, depending on the video URL (ie. youtube, etc.).

In order to accommodate self-hosted videos added by something other than the WP video block or shortcode, I would need to know how you add the video to the post/page content. I assume it's not using the WP video block, is that correct?

js.

--

WordPress developer.`
mykkal commented 1 year ago

Kyle, did you see the above reply?

kylegilman commented 1 year ago

Yeah, I'm looking into it. I have to learn more about the way the JSON schema works. I am currently using microdata, which is a term I just learned. I think adding the attachment ID to the URL only gets you part of the way there, and I am reluctant to change video URLs for users without thinking through the consequences.

mykkal commented 1 year ago

Do you have an API structure available? This is my question I haven't circled back with the other developer yet. I agree...I don't want to change the URL structure. So what about an api or XML file he could query for the info to build his schema with. The object is that his plugin does that part and yours supplies the information. He seems to be thinking of a way he can parse your output and display schema correctly relevant to the video but what if you purposely supplied an architecture other plugins could query? Then you can change your infrastructure without fear of breaking any integrations others may build. You definitely have the type of plugin folks would want to integrate with.

kylegilman commented 1 year ago

I'm working on a substantial Videopack rewrite that uses and extends the WordPress REST API and it should be very easy to provide the necessary data that way. It'll be some time before that comes out.