lundi 16 juin 2014

Getting youtube video details using the youtube API

Hey, I want to get the details of the youtube videos in my sencha app. Have already got the video id's in my store, and now I want to get the details of each video using the load function but it is giving an error .

Uncaught ReferenceError: storeInfo is not defined

Here is the load function



Code:




load: function(store, records, successful, operation, eOpts) {
function storeInfo(info) {
console.log(info.data.title);
};

function loadInfo(videoId) {
var gdata = document.createElement("script");
gdata.src = "http://ift.tt/1fyt7Sh" + videoId + "?v=2&alt=jsonc&callback=storeInfo";
var body = document.getElementsByTagName("body")[0];
body.appendChild(gdata);
};

for (var i = 0; i < records.length; i++) {
var e = records[i];

loadInfo(e.data.id.videoId)


}


}
}

In need of urgent help


Aucun commentaire:

Enregistrer un commentaire