Ticket #200 (closed bug: wontfix)

Opened 5 years ago

Last modified 5 years ago

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!

Change History

comment:1 Changed 5 years ago by jeroen

  • Milestone set to Flash 4.1

comment:2 Changed 5 years ago by jeroen

  • Type changed from enhancement to bug

comment:3 Changed 5 years ago by jeroen

  • Status changed from new to closed
  • Resolution set to wontfix

This isn't working for FMS3 servers in general...

Better to set the duration of a video with the 'duration' flashvar.

Note: See TracTickets for help on using tickets.