javascript - Using Oembed with Hulu (and understanding JSONp) -


If anyone can release any light in this process, then it would be sweet. Here's the deal. Looking at the Hulu video URL (such as 'www.hulu.com/watch/154344'), I want to use JavaScript (w / jquery is fine) to regain the embed url (i.e.)

In addition to this, just you know, I am working on local development in a development environment.

It seems that the easiest way to do this is to use the Ombed Service. Hulu offers Ombud service, which is shown. Based on the example shown on the Ombed page, the URL format should be '' for this coordinated information. And if I open that browser, which works!

So I tried to run Javascript like this:

  var url = 'http: //www.hulu com / API / oembed.xml url = http% 3a // www.hulu.com / clock / 154,344 '? $ .getJSON (url, function (data) {warning (data.mbed_rrl);});   

But, that does not work, I get an error that says:

  XMLHttpRequest can not load http://noembed.com/ embed? url = http% 3A // www.hulu.com / watch / 154344 The requested resource 'Access-Control-Permission-Origin' header is missing. Origin 'http: // localhost' is not allowed therefore entry   

So I saw a few more things. It seems that I need to use JSON. I also read that in order to enable JSONP I need to do this, the URL format has been changed with it, finally callback = data < / Code> By adding: No dice. It still gives me a single error.

What am I doing wrong?

While using JSONP with jQuery, do not give callback a name. ? Use and jQuery will replace it with your name.

  var url = 'http://www.hulu.com/api/oembed.xml? Url = http% 3A // www.hulu.com / / 154,344 & amp; clock ;? Callbâ ???? One ???? Receipt = ';    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -