如何在完全下载mp3之前找到其总时间?我有在TimerEvent.TIMER上调用的此函数

private function onTick(e:TimerEvent):void
 {
  _soundLength = _sound.length;
  _position = _channel.position;
  mp3Interface.timeBar.timers.elapsedTime.text = ascb.util.DateFormat.formatMilliseconds(_position);
  mp3Interface.timeBar.timers.totalTime.text = ascb.util.DateFormat.formatMilliseconds(_soundLength);
  var percentPlayed:Number = Math.round((_position/_soundLength)*100);
  mp3Interface.timeBar.seeker.x = (percentPlayed*mp3Interface.timeBar.progressBar.width-5)/100;
 }

问题是仅当mp3完全下载时,totalTime才正确。

最佳答案

看看mp3infoutil库。

关于flash - AS3-如何找到下载前mp3的总时间?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4278460/

10-11 19:29