Javascript SoundManager2-使用RTMP不显示持续时间

Javascript SoundManager2-使用RTMP不显示持续时间,javascript,rtmp,soundmanager2,Javascript,Rtmp,Soundmanager2,我正在使用SoundManager2通过RTMP传输mp3音频。问题是没有生成持续时间,并且持续时间始终为0 var sound = soundManager.createSound({ id: 'soundid', serverURL: 'rtmp://server/', url: 'file.mp3', autoLoad: true, autoPlay: false,

我正在使用SoundManager2通过RTMP传输mp3音频。问题是没有生成持续时间,并且持续时间始终为0

var sound = soundManager.createSound({
            id: 'soundid',
            serverURL: 'rtmp://server/',
            url: 'file.mp3',
            autoLoad: true,
            autoPlay: false,
            onload: function() {
                console.log("DURATION: ", this.duration);
            },
            whileplaying: function() {
                console.log(this.duration);
            },
            volume: 100
        }).play();

使用RTMP是否可以获得持续时间?我也尝试了
durationEstimate
,它也显示0。

默认情况下,Soundmanager2使用RTMP不计算持续时间,相反,您应该将其作为参数提供(以微秒为单位),否则,您将无法查找(设置位置(值)):

如果您没有mp3音乐的持续时间,请尝试使用mp3的ID3元数据获取它(您可以使用javascript获取它们)

var sound = soundManager.createSound({
            id: 'soundid',
            serverURL: 'rtmp://server/',
            url: 'file.mp3',
            duration: 300000,//example for a 5 minutes song
            autoLoad: true,
            autoPlay: false,
            onload: function() {
                console.log("DURATION: ", this.duration);
            },
            whileplaying: function() {
                console.log(this.duration);
            },
            volume: 100
        }).play();