[Red5] Couple of questions about using NetStream.play()
Dominick Accattato
daccattato at gmail.com
Tue Mar 3 11:08:26 PST 2009
comments inline:
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:
>
>
> http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html#play()<http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html#play%28%29>
>
> "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
> wrong?
>
> Best regards,
> Jeremy Morton (Jez)
I believe that you should receive an event. What version of Red5 are you
targeting?
>
>
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
--
Dominick Accattato, CTO
Infrared5 Inc.
www.infrared5.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090303/156a9593/attachment.html>
More information about the Red5
mailing list