<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"
>
lang="en"
OEmbed Proxy test
type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"
type="text/javascript"
var gProxyUrl = "./example-proxy.php";
function sample(aAId, aDivId) {
var url = document.getElementById(aAId).href;
var div = document.getElementById(aDivId);
var jqxhr = $.getJSON(gProxyUrl,
{url: url, maxwidth: 425},
function(data, textStatus) {
if (data.type) {
if (data.type == "video" && data.html)
div.innerHTML = data.html;
else if (data.type == "photo" && data.url)
div.innerHTML = '<img src="' + data.url + '">';
}
})
.error(function(jqXHR, textStatus) {
div.innerHTML = "request failed!";
});
}
$(document).ready(function() {
sample("test_youtube", "res_youtube");
sample("test_dailymotion", "res_dailymotion");
sample("test_vimeo", "res_vimeo");
sample("test_flickr", "res_flickr");
});
type="text/css"
.sample {
border: 1px solid gray;
margin: 1em;
}
OEmbed Proxy test
This page example use the href="http://jquery.com/"JQuery library,
linked online by Google.
class="sample"
id="test_youtube" href="http://www.youtube.com/watch?v=vk1HvP7NO5w"
http://www.youtube.com/watch?v=vk1HvP7NO5w
id="res_youtube"
This div should display a youtube video, and not this text.
class="sample"
id="test_dailymotion" href="http://www.dailymotion.com/video/x5ioet_phoenix-mars-lander_tech"
http://www.dailymotion.com/video/x5ioet_phoenix-mars-lander_tech
id="res_dailymotion"
This div should display a Dailymotion video, and not this text.
class="sample"
id="test_vimeo" href="http://www.vimeo.com/1211060"
http://www.vimeo.com/1211060
id="res_vimeo"
This div should display a Vimeo video, and not this text.
class="sample"
extended provider
id="test_flickr" href="http://www.flickr.com/photos/fuffer2005/2435339994/"
http://www.flickr.com/photos/fuffer2005/2435339994/
id="res_flickr"
This div should display a Flickr sample, and not this text.