Ticket #200 (closed bug: wontfix)
add getStreamLength call for mp3 rtmp
| Reported by: | jeroen | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | Flash 4.1 | |
| Component: | Keywords: | ||
| Cc: | Forum thread: |
Description
I've hacked the code and got this working for FMS3 at least. I'm slightly amazed. All hail open source .... :)
Added code into the setStart() function of FLVModel.as as follows:
[quote] if (flvType=="RTMP" && feeder.feed[currentItem]id? != currentURL) { connectObject.connect(feeder.feed[currentItem]file?); currentURL = feeder.feed[currentItem]id?; setStreamObject(connectObject); streamObject.play(currentURL); /* added getStreamLength() call here / var ref = this; var resObj = new Object(); resObj.onResult = function (val:Number):Void { ref.feeder.feed[ref.currentItem]duration? = val; } connectObject.call("getStreamLength",resObj,currentURL); } quote
With this in place, MP3 streaming with scrubbing (and proper begin and end times) works like a charm.
This should work with FMS3, or any FMS2 app that defines a Client.prototype.getStreamLength() function. The FMS3 "vod" service does this for you thankfully.
Of course there's no error handler for when no getStreamLength function is defined, so it'll probably break for Red5.
Also I'd prefer the metadata to be used in preference, but I'm not sure how best to do this - suggestions welcome!
