web-stories-wp icon indicating copy to clipboard operation
web-stories-wp copied to clipboard

Add videos structured data

Open swissspidy opened this issue 2 years ago • 8 comments

Feature Description

Context: https://developers.google.com/search/docs/advanced/structured-data/video

This is basically like #11624, but for videos within a story.

We have a lot of information about videos already (URL, alt text, poster, duration, upload date) that is required or useful for VideoObject

I'd like to try this out for stories to see how well it works in WordPress

Alternatives Considered

Additional Context

swissspidy avatar Sep 05 '22 17:09 swissspidy

With products, we exact all the product data into another piece of post meta. This is so we don't have to parse data out of story data.

Would you expect all videos we in structure data?

  • Do we include video that are background media of a page?
  • Do we include videos without sound?
  • Does a mp4 that is a gif count as a video?
  • Do we include videos on a page, what if a page has multiple videos, like one animates in later or something?

spacedmonkey avatar Sep 15 '22 11:09 spacedmonkey

Great questions!

Let's start with all video elements with sound, regardless of position or animation. No GIF elements.

swissspidy avatar Sep 15 '22 16:09 swissspidy

@swissspidy Should we exact the video data into post meta then?

spacedmonkey avatar Sep 16 '22 16:09 spacedmonkey

Yes, very similar to how we did that for products in #11624

swissspidy avatar Sep 16 '22 19:09 swissspidy

Having a look at the fields, I just want to confirm that field mapping.

Required fields

Name Type Field
description text resource. alt
name text ????
thumbnailUrl url resource. poster
uploadDate date resource.creationDate

Recommended

Name Type Field
contentUrl URL resource. src
duration Duration resource.length

I am not sure what to map name to. Name is a required field, so a blocker.

Also to confirm.

  • Do we include hotlinked videos?
  • Do we include videos from third party media source, like coverr?

spacedmonkey avatar Sep 26 '22 10:09 spacedmonkey

Let's reuse alt text for the name field for name, for proof-of-concept purposes.

Let's exclude external videos for now.

swissspidy avatar Sep 28 '22 06:09 swissspidy

@swissspidy Should this be behind a feature flag then?

spacedmonkey avatar Sep 28 '22 10:09 spacedmonkey

Yeah let‘s do that.

swissspidy avatar Sep 28 '22 12:09 swissspidy

Closing this for now until I hear more about this, keeping the board clean.

swissspidy avatar Nov 15 '22 15:11 swissspidy