作用域的问题请大家看看
先上代码:
var __mplayer_process;
function __loop(keys,mplayer){
jingCore.search(keys,function(results){
logger.correct('播放中>>');
mplayer = exec('mplayer -slave -quiet '+results.toString().replace(/,/g,' '),{
maxBuffer:20000*1024
},function(error,stdout,stderr){
if(error)
logger.error('error occur');
logger.correct('finished and next list is coming');
return __loop(keys,mplayer);
})
})
}
__loop(‘a’,__mplayer_process)的时候内层无法传递mplayer参数。