Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.58k stars 799 forks source link

Media: Improve support for video blocks #30642

Open kraftbj opened 1 year ago

kraftbj commented 1 year ago

While testing a post with primarily a video, there is no embedded video, no thumbnail, etc.

If you post some types of videos, the preview on Mastodon is nice: https://mastodon.social/@KraftTesting/110351999349478465

If you post others, it isn’t: https://mastodon.social/@KraftTesting/110350762986457391

Looking, our media summary class determines if the post “type” is standard vs video vs etc based on a few criteria… certain embeds or shortcodes https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/jetpack/_inc/lib/class.media-summary.php#L37

If you had a VideoPress video that was embedded using the old shortcodes, it would decide (with other markers, such as total number of paragraphs) that the post is a “video” post. https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/jetpack/_inc/lib/class.media-summary.php#L109 or if it had a YouTube/Vimeo, etc post embedded into the content, it would decide that the post is a “video” post https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/jetpack/_inc/lib/class.media-summary.php#L179

If you’re using VideoPress in the modern way (or any block that inserts video outside of the Youtube, etc embed blocks which is what happens there), we don’t have any handling to mark the post as a “video” post.

In support of #7790

kraftbj commented 1 year ago

VP videos do not work: https://mastodon.social/@KraftTesting/110350762986457391 Embedding YouTube does: https://mastodon.social/@KraftTesting/110351999349478465

Initial look suggests to me this may be more related to the Media_Summary / Media_Extractor classes are still looking for VideoPress shortcodes and, for the embeds it does look for, VideoPress isn't one of them.