forked from hoyois/plugin-to-html5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vodpod.js
42 lines (37 loc) · 884 Bytes
/
Vodpod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Vodpod killer (2011-09-16)
addKiller("Vodpod", {
"canKill": function(data) {
return data.src.indexOf("widgets.vodpod.com/w/video_embed/") !== -1;
},
"process": function(data, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', "http://metauri.com/show.xml?uri=" + encodeURIComponent(data.src), true);
xhr.onload = function() {
var xml = xhr.responseXML;
data.src = xml.getElementsByTagName("last_effective_uri")[0].textContent;
var k;
if(hasKiller("YouTube")) {
k = getKiller("YouTube");
if(k.canKill(data)) {
k.process(data, callback);
return;
}
}
if(hasKiller("Vimeo")) {
k = getKiller("Vimeo");
if(k.canKill(data)) {
k.process(data, callback);
return;
}
}
if(hasKiller("Blip")) {
k = getKiller("Blip");
if(k.canKill(data)) {
k.process(data, callback);
return;
}
}
};
xhr.send(null);
}
});