|
|
@ -967,13 +967,13 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { |
|
|
|
|
|
|
|
|
|
|
|
youtube: { |
|
|
|
youtube: { |
|
|
|
|
|
|
|
|
|
|
|
get: function(id) { |
|
|
|
get: function(mid, id) { |
|
|
|
var url = "http://gdata.youtube.com/feeds/api/videos/" + id + "?v=2&alt=jsonc&callback=?"; |
|
|
|
var the_url = "http://gdata.youtube.com/feeds/api/videos/" + mid + "?v=2&alt=jsonc&callback=?", |
|
|
|
|
|
|
|
vid = {mid: mid, id: id}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VMM.master_config.youtube.que.push(vid); |
|
|
|
|
|
|
|
|
|
|
|
if (VMM.master_config.youtube.active) { |
|
|
|
if (!VMM.master_config.youtube.active) { |
|
|
|
VMM.master_config.youtube.que.push(id); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
VMM.master_config.youtube.que.push(id); |
|
|
|
|
|
|
|
if (!VMM.master_config.youtube.api_loaded) { |
|
|
|
if (!VMM.master_config.youtube.api_loaded) { |
|
|
|
VMM.LoadLib.js('http://www.youtube.com/player_api', function() { |
|
|
|
VMM.LoadLib.js('http://www.youtube.com/player_api', function() { |
|
|
|
trace("YouTube API Library Loaded"); |
|
|
|
trace("YouTube API Library Loaded"); |
|
|
@ -982,19 +982,22 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// THUMBNAIL
|
|
|
|
// THUMBNAIL
|
|
|
|
VMM.getJSON(url, VMM.ExternalAPI.youtube.createThumb); |
|
|
|
VMM.getJSON(the_url, function(d) { |
|
|
|
|
|
|
|
VMM.ExternalAPI.youtube.createThumb(d, vid) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
create: function(id) { |
|
|
|
create: function(vid) { |
|
|
|
|
|
|
|
|
|
|
|
var p = { |
|
|
|
var p = { |
|
|
|
active: false, |
|
|
|
active: false, |
|
|
|
player: {}, |
|
|
|
player: {}, |
|
|
|
name: 'youtube_'+id, |
|
|
|
name: 'youtube_'+vid.id, |
|
|
|
playing: false |
|
|
|
playing: false |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
p.player['youtube_'+id] = new YT.Player('youtube_'+id, { |
|
|
|
p.player['youtube_'+vid.id] = new YT.Player('youtube_'+vid.id, { |
|
|
|
height: '390', |
|
|
|
height: '390', |
|
|
|
width: '640', |
|
|
|
width: '640', |
|
|
|
playerVars: { |
|
|
|
playerVars: { |
|
|
@ -1004,7 +1007,7 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { |
|
|
|
theme: 'light', |
|
|
|
theme: 'light', |
|
|
|
rel: 0 |
|
|
|
rel: 0 |
|
|
|
}, |
|
|
|
}, |
|
|
|
videoId: id, |
|
|
|
videoId: vid.mid, |
|
|
|
events: { |
|
|
|
events: { |
|
|
|
'onReady': VMM.ExternalAPI.youtube.onPlayerReady, |
|
|
|
'onReady': VMM.ExternalAPI.youtube.onPlayerReady, |
|
|
|
'onStateChange': VMM.ExternalAPI.youtube.onStateChange |
|
|
|
'onStateChange': VMM.ExternalAPI.youtube.onStateChange |
|
|
@ -1014,9 +1017,12 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { |
|
|
|
VMM.master_config.youtube.array.push(p); |
|
|
|
VMM.master_config.youtube.array.push(p); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
createThumb: function(d) { |
|
|
|
createThumb: function(d, vid) { |
|
|
|
|
|
|
|
trace("CREATE THUMB"); |
|
|
|
|
|
|
|
trace(d); |
|
|
|
|
|
|
|
trace(vid); |
|
|
|
if (typeof d.data != 'undefined') { |
|
|
|
if (typeof d.data != 'undefined') { |
|
|
|
var thumb_id = "youtube_" + d.data.id + "_thumb"; |
|
|
|
var thumb_id = "youtube_" + vid.id + "_thumb"; |
|
|
|
VMM.attachElement("#" + thumb_id, "<img src='" + d.data.thumbnail.sqDefault + "'>"); |
|
|
|
VMM.attachElement("#" + thumb_id, "<img src='" + d.data.thumbnail.sqDefault + "'>"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|