[Red5] Couple of questions about using NetStream.play()
daccattato at gmail.com
Tue Mar 3 11:08:26 PST 2009
On Tue, Mar 3, 2009 at 6:54 AM, Jeremy Morton <admin at game-point.net> wrote:
> Firstly, is it me, or is Adobe's documentation for the first argument to be
> passed to .play() decidedly dodgy? From the docs:
> "The name of a recorded file without a file extension, an identifier for
> live data published by NetStream.publish(), or false. To play MP3 files,
> use mp3 before the name. To play the ID3 tag of an MP3 file, use id3:
> before the name. If false, the stream stops playing and any additional
> parameters are ignored."
> This would seem to suggest that you should never pass a filename as the
> first argument, eg. never pass "file.mp3" but pass instead "mp3:file". Am
> I reading that right? Not only is that totally different to how it was
> done in Actionscript 2 (you just passed a file name!), but passing a file
> name DOES work! I tried it by just putting the file in the Red5 streams
> dir, specifying the file name in .play(), and it worked. So what's up with
> that Adobe documentation?
I believe that we handle this within Red5 by checking to see if the prefix
exists. If it exists, we play the file with the .mp3 extension. If the
extension doesn't exist, we look for the file with the given extension. So
either way should work.
> Secondly, the documentation says,
> "If the video file can't be found, the netStatus event is dispatched."
> I dunno if this is an error with my code or Red5, but this doesn't seem to
> be happening. If I specify an invalid file name for .play(), even though
> I've done this previously:
> ns = new NetStream(nc);
> ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
> ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
> Neither of my handlers are called, there doesn't seem to be any
> notification from Red5 that the file didn't exist. Am I doing something
> Best regards,
> Jeremy Morton (Jez)
I believe that you should receive an event. What version of Red5 are you
> Red5 mailing list
> Red5 at osflash.org
Dominick Accattato, CTO
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Red5