#32714 closed defect (bug) (fixed)
oEmbed of m.youtube.com links don't render
Reported by: | undergroundnetwork | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Embeds | Keywords: | good-first-bug has-patch |
Focuses: | Cc: |
Description
When a user is using a mobile phone to post to Wordpress, and they copy and paste a YouTube URL, YouTube changes the URLs of it's videos when accessed on a mobile phone by adding an m. before the URL, like: https://m.youtube.com/watch?v=yfUflij74P4
This results in Wordpress not recognizing that it is a YouTube URL and oEmbed does not render as a result.
This causes problems when using Press This as Press This grabs the URL which has an m. in it. This is a problem when a user has copied a YouTube URL on their phone (via the URL address bar, or the share menu on most phones) and they try to paste it into an article, because, again, YouTube puts that m. in the URL.
In order to make this work, perhaps a filter that removes the m. from YouTube URLs would help and the URLs could then render.
Attachments (2)
Change History (27)
#1
@
9 years ago
- Keywords needs-patch needs-unit-tests good-first-bug added
- Milestone changed from Awaiting Review to Future Release
- Version changed from 4.2.2 to 3.9
#2
@
9 years ago
- Summary changed from oEmbed of YouTube links via mobile phones don't render. to oEmbed of m.youtube.com links don't render
#5
@
9 years ago
I have attached a patch for wp-includes/class-oembed.php. It should now handle both www. and m..
I have found that code for PressThis in wp-admin/includes/class-wp-press-this.php already handles both www. and m. YouTube site.
#6
@
9 years ago
- Keywords has-patch added; needs-patch needs-unit-tests removed
- Milestone changed from Future Release to 4.3
Thanks Toru. All looks good. 32714.tests.patch adds some tests.
#7
@
9 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 32930:
#9
follow-up:
↓ 10
@
9 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This fix seems to no longer work, the mobile YouTube links no longer rendering again. This link does not render for example:
https://m.youtube.com/watch?feature=youtu.be&v=peVH0k0Hisc
Perhaps YouTube changed the format of their links?
Charles
#10
in reply to:
↑ 9
@
9 years ago
Replying to undergroundnetwork:
This fix seems to no longer work, the mobile YouTube links no longer rendering again. This link does not render for example:
https://m.youtube.com/watch?feature=youtu.be&v=peVH0k0Hisc
Which version are you testing? Your link seems to work for me:
var_dump( esc_html( wp_oembed_get( 'https://m.youtube.com/watch?feature=youtu.be&v=peVH0k0Hisc' ) ) ); // string(189) "<iframe width="660" height="371" src="https://www.youtube.com/embed/peVH0k0Hisc?feature=oembed" frameborder="0" allowfullscreen></iframe>"
#11
@
9 years ago
I'm running 4.2.4, the first test was on an iPad using Press This.
Oh wait! Is this not supposed to work until 4.3?? Did I just screw up?
If it is supposed to work, here is another example, I just took this YouTube link:
https://m.youtube.com/watch?feature=youtu.be&v=CDsNZJTWw0w
Pasted it into my new post and again it doesn't render.
I just ran it on a clean site, twenty12 theme, no plugins, but this link will render:
https://youtube.com/watch?feature=youtu.be&v=CDsNZJTWw0w
Again, if this is not supposed to work until 4.3 I apologize for reopening this again.
Thanks for the report!