javascript - vimeo-api. access 'duration' property outside the function -


i want use 'duration' of video variable elsewhere in javascripts (especially on event 'ready'), seem unable access property.

player.addevent('ready', function() {     ...      var duration='';     player.api('getduration', duration);      function duration(data){       $('somediv').text(data); //works fine       duration = data;     } console.log(duration);     // doesn't work 

what right way access value?


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -