Actionscript 3 NetStream.seek能否移动MP3的播放头?

Actionscript 3 NetStream.seek能否移动MP3的播放头?,actionscript-3,mp3,metadata,netstream,Actionscript 3,Mp3,Metadata,Netstream,我创建了一个自定义的SWF来播放使用RTMP和的MP3。我可以连接到服务器,播放和暂停mp3,并使用调整音量。但是我仍然无法从中检索元数据来创建搜索栏 可以移动流式mp3文件的播放头吗?要制作搜索栏,您必须知道mp3的长度(持续时间)。要实现这一点,您可以使用服务器端函数,连接后可以调用该函数,如下所示: var nc:NetConnection = new NetConnection(); const stream:String = 'mp3:mp3_file'; // mp3_file.

我创建了一个自定义的SWF来播放使用RTMP和
的MP3。我可以连接到服务器,播放和暂停mp3,并使用
调整音量。但是我仍然无法从
中检索元数据来创建搜索栏


可以移动流式mp3文件的播放头吗?

要制作搜索栏,您必须知道mp3的长度(持续时间)。要实现这一点,您可以使用服务器端函数,连接后可以调用该函数,如下所示:

var nc:NetConnection = new NetConnection();
const stream:String = 'mp3:mp3_file';   // mp3_file.mp3

// all other declarations, initializations and the connection to the server

// after receiving NetConnection.Connect.Success    
var responder:Responder = new Responder(function(duration:Object){
    trace('mp3 duration : ', duration);
})
nc.call('getStreamLength', responder, stream);
收到持续时间后,可以绘制搜索栏

有关更多信息,您可以查看


希望这能有所帮助。

这很有效。以前,我试图通过
netstream.client.duration
获取metedata,但是服务器端脚本工作得很好。