Index: lams_tool_kaltura/web/pages/authoring/basic.jsp =================================================================== diff -u -r3309f36be5a5b01643991adcccbb1a7045e3b4ea -re80818aae7410906f018e124a1a18517b51b9bbf --- lams_tool_kaltura/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 3309f36be5a5b01643991adcccbb1a7045e3b4ea) +++ lams_tool_kaltura/web/pages/authoring/basic.jsp (.../basic.jsp) (revision e80818aae7410906f018e124a1a18517b51b9bbf) @@ -105,25 +105,24 @@ // Get etries titles from Kaltura server. Regrdless of success save the video with LAMS. for(var i = 0; i < entries.length; i++) { - var entryId = entries[i].entryId; + var kalturaEntryId = entries[i].entryId; kClient.media.get( function (success, data){ - var title = ""; - var duration = 0; - + if(!success) { alert("Error on getting entry title. Data: " + data); } else if (data.code && data.message){ alert("Error on getting entry title: " + data.message); } else { - title = data.name; - duration = data.duration; - } + var title = data.name; + var duration = data.duration; + var entryId = data.id; - addItem(entryId, title, duration); - }, - entryId + addItem(entryId, title, duration); + } + }, + kalturaEntryId ); } }