I am trying to include Dailymotion in my web app. I have one javascript file (for Dailymotion) and an inline javascript.I am trying to get the recomemmended videos from DM, for which I have a function ready.
Dailymotion.js looks something like this
login();
function login(){
  getScreenname();
}
function getScreename(){
  // print some name
}
function getRecoVideos(callback){
  callback(result);
}
Inline.js
getRecoVideos(function(result){
  console.log(result);
});
In the inline.js file, the call to getRecoVideos doesn't work because, the login is not finished. How can I synchronize the calls?
 
     
     
    