Opened 12 years ago
Closed 11 years ago
#24660 closed defect (bug) (fixed)
YouTube oEmbeds don't work for full-width YouTube video links
Reported by: | designsimply | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Embeds | Keywords: | has-patch |
Focuses: | Cc: |
Description
Steps to reproduce:
- Go to Posts > Add New
- Add this to its own line in the content area:
http://www.youtube.com/embed/8N_tupPBtWQ
- Publish the post
- Expected: using http://www.youtube.com/embed/8N_tupPBtWQ on it's own line in a post would trigger an oEmbed for a YouTube video
- Actual: oEmbed doesn't work for links like http://www.youtube.com/embed/tgbNymZ7vqY it only works for links like http://www.youtube.com/watch?v=tgbNymZ7vqY
Screencast: http://screencast.com/t/nMCYr3N3uF
Tested with WordPress trunk version 24528 on Bluehost
Should links like http://www.youtube.com/embed/tgbNymZ7vqY be working for oEmbed, or do you just need to make sure to use links like http://www.youtube.com/watch?v=tgbNymZ7vqY to avoid the problem?
Attachments (2)
Change History (14)
#1
@
12 years ago
#2
@
12 years ago
- Keywords close added
The src of the returned iframe from the oEmbed endpoint contains the embed
part. You should just use the links, which YouTube gives you.
#3
@
12 years ago
I think users tend to copy out the URL from the Share > Embed section on YouTube pages, and that's what gets them confused (it gets reported from time to time in WP.com support which is why I created this ticket).
Aside: the long version of youtube.com mobile URLs have the same problem. If you are on a mobile device such as an iPad and copy the URL directly from a YouTube page, the link will not auto embed. Example link:
In contrast, auto embeds for the short version of mobile URLs worked fine in my tests:
Tested with WP trunk r24579 on Bluehost + Twenty Thirteen theme.
To fix both the "/embed/" URL and the mobile URL issues, could the unique identifier (such as "tgbNymZ7vqY") be pulled out and then used in whatever oEmbed URL structure is supported?
#5
@
11 years ago
- Keywords dev-feedback 2nd-opinion added
I tend to agree with designsimply, this may be something we wish to do simply to make the user experience that much more intuitive and simple, especially if people are having an issue copying out the URL on mobile.
I am +1 to implementing this change, but would like some dev-feedback and a second opinion on this matter.
#6
@
11 years ago
If you go to Share > Embed, it gives you the <iframe>
code to paste in - using the src
from there is a you-break-it-you-bought-it situation. The /embed/
and mobile with #
would have to be new YouTube oEmbed providers in WP, but would need additional hacks to turn /embed/
into /watch?v=
. Might be best tackled in pre_kses
or something.
Jetpack does all kinds of crazy stuff to YouTube URLs. I actually turned off most of what it does on a site I am building, but for these scenarios, there is probably some useful code in there.
#7
@
11 years ago
this is not a bug. Youtube give two types url for users:
1) short: youtu.be/tgbNymZ7vqY
2) and full: youtube.com/watch?v=tgbNymZ7vqY
link like yours youtube.com/embed/8N_tupPBtWQ
provided only for embed src in iframe or <object> tag and
not intended for use by users
#8
@
11 years ago
If it's not a bug, then it should be an enhancement ticket. :) I posted it because I saw support tickets from several users saying it was broken. Not a crazy high priority, but it seemed like something that could just be made to work nicely with popular types of URLs that users find and enter (even if they're doing it wrong).
#9
@
11 years ago
- Keywords needs-patch added; dev-feedback 2nd-opinion removed
- Milestone changed from Awaiting Review to 4.0
I was about to close this, then I realized there is a slightly-relevant precedent with wp_embed_handler_googlevideo
Someone can patch this for 4.0, or we can decide that we aren't going to do anything
#10
@
11 years ago
This patch should support embed/
and #/
for YouTube video links. Am i in the right direction here?
#11
@
11 years ago
- Keywords has-patch added; needs-patch removed
24660.diff fixes /embed/.*
URLs and makes them to display watch?v=.*
videos
Looks like YouTube oEmbed endpoint only works for
/watch?v=...
links.This works:
This returns a 404 error: