-
Notifications
You must be signed in to change notification settings - Fork 382
Closed
Labels
Milestone
Description
Bug Description
Embedding a video from YouTube containing a hyphen in the ID is failing to embed in v1.5, where it worked in v1.4.
Embedding this video for example: https://www.youtube.com/watch?v=xo68-iWaKv8
In 1.4.4:
<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-has-aspect-ratio">
<div class="wp-block-embed__wrapper">
<amp-youtube data-videoid="xo68-iWaKv8" layout="responsive" width="16" height="9"></amp-youtube>
</div>
</figure>In 1.5.1:
<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-has-aspect-ratio">
<div class="wp-block-embed__wrapper">
<amp-youtube data-videoid="xo68" layout="responsive" width="16" height="9" title="Standing Tall For Dwarfism: Quaden Bayles">
<a placeholder href="https://youtu.be/xo68-iWaKv8" class="monsterinsights-internal-as-outbound" data-vars-category="outbound-link-int" data-vars-action="https://youtu.be/xo68-iWaKv8" data-vars-label="">
<amp-img src="https://i0.wp.com/i.ytimg.com/vi/xo68/hqdefault.jpg?w=1220&ssl=1" layout="fill" object-fit="cover" alt="Standing Tall For Dwarfism: Quaden Bayles" class="amp-wp-enforced-sizes">
<noscript>
<img src="https://i0.wp.com/i.ytimg.com/vi/xo68/hqdefault.jpg?w=1220&ssl=1" alt="Standing Tall For Dwarfism: Quaden Bayles">
</noscript>
</amp-img>
</a></amp-youtube>
</div>
</figure>Notice how the video ID is truncated from xo68-iWaKv8 to xo68.
Expected Behaviour
Video IDs containing hyphens should render properly.
Steps to reproduce
- Embed a YouTube video: https://www.youtube.com/watch?v=xo68-iWaKv8
- View the AMP page
- Notice a broken player
Screenshots
Additional context
- WordPress version: 5.4
- Plugin version: 1.5.1
Issue may have been introduced in #3358 or #3678.
Reported in this support topics:
- https://wordpress.org/support/topic/content-mismatch-missing-embedded-video-6/
- https://wordpress.org/support/topic/youtube-embed-problem-when-the-video-url-has-a-dash-character/
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
Reactions are currently unavailable
