WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 9 months ago

#11556 closed enhancement (fixed)

Add support for embedding YouTu.be URLs

Reported by: Viper007Bond Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9
Component: Embeds Keywords: has-patch tested
Focuses: Cc:

Description

http://youtube-global.blogspot.com/2009/12/make-way-for-youtube-links.html

Allows you to embed them. Needs to be transformed internally as their oEmbed provider doesn't support them. Adds a new filter to do it.

Attachments (2)

11556.patch (1.3 KB) - added by Viper007Bond 5 years ago.
11556.2.patch (962 bytes) - added by Viper007Bond 5 years ago.
Whitelist youtu.be

Download all attachments as: .zip

Change History (13)

@Viper007Bond5 years ago

comment:1 @hakre5 years ago

  • Keywords needs-testing added

comment:2 @nacin5 years ago

  • Keywords tested added; needs-testing removed

comment:3 follow-up: @westi5 years ago

  • Keywords reporter-feedback added

Could we not just register youtu.be as another oembed provided and rely on the 302 following of the HTTP handlers.

That way we don't need any youtu.be specific code in here and if they change the url format of any of the providers in future and offer 302 redirects we would follow those too?

comment:4 in reply to: ↑ 3 @Viper007Bond5 years ago

Replying to westi:

Could we not just register youtu.be as another oembed provided and rely on the 302 following of the HTTP handlers.

That way we don't need any youtu.be specific code in here and if they change the url format of any of the providers in future and offer 302 redirects we would follow those too?

No, because their oEmbed provider doesn't understand their shortened URLs.

Example short URL: http://youtu.be/nTDNLUzjkpg

Their provider returns a 401 for that URL: http://www.youtube.com/oembed?format=xml&url=http%3A%2F%2Fyoutu.be%2FnTDNLUzjkpg

Ideally their oEmbed provider should support their short URLs. I didn't think that'd be possible, however I recently saw one of the YouTube people post to the oEmbed mailing list, so I'll see if I can get them to support their short URLs so we can just map them directly to their oEmbed provider.

comment:5 @ryan5 years ago

  • Component changed from General to oEmbed

comment:6 @nacin5 years ago

  • Milestone 3.0 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

YouTube's oEmbed provider now understands shortened URLs.

comment:7 @Viper007Bond5 years ago

Sweet. :)

comment:8 follow-up: @Viper007Bond5 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Actually, we still need to add that format to the whitelist, we just don't need a remapping function.

comment:9 in reply to: ↑ 8 @nacin5 years ago

Replying to Viper007Bond:

Actually, we still need to add that format to the whitelist, we just don't need a remapping function.

Oops, yep.

@Viper007Bond5 years ago

Whitelist youtu.be

comment:10 @automattor5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [13203]) Add Youtu.be short URLs and Smugmug to the default oEmbed providers. Props Viper007Bond, fixes #11556, fixes #12157

comment:11 @DrewAPicture9 months ago

  • Keywords reporter-feedback removed
  • Milestone set to 3.0
Note: See TracTickets for help on using tickets.