We're implementing Adobe's Flash Media Server at work and while working on some prototypes recently, I came across a little weirdness when using NetConnection and NetStream to access FLV files versus using the Flash 8 Video Playback component.
In all the examples I've seen, the following code is used to playback local FLVs that are in the same relative location as the SWF via progressive download:
transcode-language: actionscript
stop();
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myFLV.attachVideo(ns);
ns.play("LQ_PMO_fl7.flv");
But, to truly stream the FLV from the media server, we need to change the script just a bit to this:
transcode-language: actionscript stop();
var nc:NetConnection = new NetConnection();
nc.connect("rtmp://qfms/mycollection");
var ns:NetStream = new NetStream(nc);
myFLV.attachVideo(ns);
ns.play("LQ_PMO_fl7.flv");
Problem was, this never worked and I couldn't figure out why. Well finally, after a bit of poking around I realized when streaming you need to omit the FLV file extension on the ns.play command like this:
ns.play("LQ_PMO_fl7");
I'm not sure if this is stated somewhere plain and obvious within the FMS docs, but it took me a while to figure it out.
Yep.
This is documented standard behaviour for FMS. I guess since it is always expecting an .flv to stream, it was deemed as unnecessary :)
But is it actually documented somewhere that you need to leave off the file extension? What if you're streaming an MP3?