forked from hoyois/plugin-to-html5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNovamov.js
38 lines (33 loc) · 968 Bytes
/
Novamov.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
// novamov killer (2012-01-03)
addKiller("novamov", {
"canKill": function(data) {
if(!canPlayFLV) return false;
if(/novaplayerv3\.swf/.test(data.src)) {return true;};
return false;
},
"process": function(data, callback) {
var flashvars = parseFlashVariables(data.params.flashvars);
var url = "http://www.novamov.com/api/player.api.php?key=" + flashvars.filekey + "&pass=undefined&codes=" + flashvars.cid + "&file=" + flashvars.file;
var xhr = new XMLHttpRequest();
var _this = this;
xhr.open('GET', url, true);
xhr.onload = function(event) {
_this.parseResponse(parseFlashVariables(event.target.responseText), callback);
};
xhr.send(null);
},
"parseResponse": function(response, callback) {
if (response.url && response.title) {
callback({
"playlist": [{
"title": decodeURIComponent(response.title).replace(/&(.+)/i,""),
"sources": [{
"url": response.url,
"format": "FLV",
"isNative": false
}]
}]
});
}
}
});