oEmbed - One API to rule them all

1,954 views

Published on

The use of oEmbed in Citysearch Australia.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,954
On SlideShare
0
From Embeds
0
Number of Embeds
422
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

oEmbed - One API to rule them all

  1. 1. oEmbedOne API to rule them all Tyrell Perera
  2. 2. A bit of background info…• Citysearch editors use video content eg: Movie reviews• Copy-pasting embed HTML • Makes media content hard to index, re-use and error prone • We wanted to add a video module to our new CMS
  3. 3. The challenge
  4. 4. oEmbed• A open web service specification – Allows third party content providers (ie: Citysearch) to – request media content meta-data (including iFrame HTML) using the media URL – from the original content provider (ie: YouTube)
  5. 5. How?• Original content provider creates the REST/JSON service adhering to the oEmbed specification• Makes the service discoverable by including the end-points in the <HEAD> of their existing (X)HTML documents
  6. 6. Service Discovery<link rel="alternate" type="application/json+oembed"href="http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3DxnUSbL3Ke90&amp;format=json" title="The Online Gamer: Bloopers –3"> <link rel="alternate" type="text/xml+oembed"href="http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3DxnUSbL3Ke90&amp;format=xml" title="The Online Gamer: Bloopers -3">
  7. 7. A subset of providers withoEmbed services
  8. 8. Third party consumers• Invoke the service by passing the URL and response type as mandatory parameters• There can be optional parameters too – Video width and height for instance
  9. 9. A quick example
  10. 10. Figuring out which providerto talk to ...• We used a JQuery plugin  • jquery-oembed.js• Uses jsonp • Asynchronous • Cross-domain calls
  11. 11. Example
  12. 12. Solved!!
  13. 13. Minor bumps on the road• Most of the video content from YouTube• YouTubes oEmbed service doesnt support jsonp callbacks  • Jquery-oembed uses Embed.ly === $$$$• We wrote a service wrapper for YouTube• Patched jquery-oembed.js to use our end- point instead 
  14. 14. References• oEmbed: http://oembed.com/• Jquery oEmbed plugin: https://code.google.com/p/jquery-oembed/
  15. 15. Questions?

×