WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 17 months ago

#37552 new enhancement

Youtube Oembed ignores parameter(s)

Reported by: deas0815 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.5.3
Component: Embeds Keywords: close
Focuses: Cc:

Description

Parameters (such as rel=0) don't propagate to rendered HTML.

I expect a youtube URL such as

https://www.youtube.com/watch?v=6RZkmGYednU&rel=0

in the content do render a video with related video display disabled. However, it displays related videos since rel=0 does not propagate.

Change History (1)

#1 @swissspidy
17 months ago

  • Keywords close added
  • Type changed from defect (bug) to enhancement

Hey there,

Thanks for your report and welcome to Trac!

YouTube seems to support the rel parameter in the resulting iframe, but ignores it at the oEmbed endpoint for some reason. So that's a YouTube issue. There are plenty of other parameters YouTube ignores with oEmbed (iv_load_policy, showinfo, vq, etc.).

We would have to manually parse the URL and change the embed code to include those, which is hacky at best (the embed code can change any day). Thus, I would say this is plugin territory. Here's one plugin you can try: https://wordpress.org/plugins/hide-youtube-related-videos/

Related: #31920, although there YouTube supports the t parameter.

Note: See TracTickets for help on using tickets.