Question
SMIL based variable bandwidth playlists for streaming flash video from Flash Media Server 2
I've spent most of the last couple of days crawling through
the PDFs for client and server side AS, along with the technotes
and samples, attempting to get a clear understanding of how to get
SMIL XML based dynamic bandwidth streaming from FMS2. I've been
able to code from scratch a nice NetStream based solution, but
really want to use the dynamic bandwidth management and loose
coupling of the SMIL based solution. Currently I've got the
following setup:
Windows 2003 Server
IIS 6
serving a swf containg the following button which dynamically loads the smil file from the same directory as the swf:
on( click ){
import mx.video.*;
_root.vid_ctrl.contentPath = " http://localhost/flashVid/streams.xml";
trace( "contentPath: "+ _root.vid_ctrl.contentPath );
var listenerObject:Object = new Object();
listenerObject.metadataReceived = function(eventObject:Object):Void {
_root.vid_ctrl.setSize(vid_ctrl.preferredWidth, vid_ctrl.preferredHeight);
_root.vid_ctrl.seek(4);
trace( "contentPath after metadata: "+ _root.vid_ctrl.contentPath );
}
_root.vid_ctrl.addEventListener("metadataReceived", listenerObject);
}
[from livedocs article: http://livedocs.macromedia.com/flash/8/main/00003539.html
This is the content of the XML SMIL file:
<smil>
<head>
<meta base="rtmp://localhost/bls_videos/_definst_" />
<layout>
<root-layout width="320" height="256" />
</layout>
</head>
<body>
<switch>
<video src="Bag-mask 1 resc (512)" system-bitrate="512000" />
<video src="Bag-mask 2 resc (512)" system-bitrate="128000" />
</switch>
</body>
</smil>
I can see in my server log for the bls_videos app that a connection is being made, but no streams are showing on the streams tab, and no response on the client. The following is logged on server when the connection is made:
welcome[object Client]
Error : command msg sent before client connection has been accepted.
Error : command msg sent before client connection has been accepted.
The Welcome is a trace line I put into the main.asc to ensure it was getting called. Not sure what the error is about.
Any more detailed information on using the SMIL XML files for streaming - particularly a fully worked end to end example, would be useful.After trawling through the various online and offline docs on this subject there is very little to guide anyone.
thanks
Nick
Windows 2003 Server
IIS 6
serving a swf containg the following button which dynamically loads the smil file from the same directory as the swf:
on( click ){
import mx.video.*;
_root.vid_ctrl.contentPath = " http://localhost/flashVid/streams.xml";
trace( "contentPath: "+ _root.vid_ctrl.contentPath );
var listenerObject:Object = new Object();
listenerObject.metadataReceived = function(eventObject:Object):Void {
_root.vid_ctrl.setSize(vid_ctrl.preferredWidth, vid_ctrl.preferredHeight);
_root.vid_ctrl.seek(4);
trace( "contentPath after metadata: "+ _root.vid_ctrl.contentPath );
}
_root.vid_ctrl.addEventListener("metadataReceived", listenerObject);
}
[from livedocs article: http://livedocs.macromedia.com/flash/8/main/00003539.html
This is the content of the XML SMIL file:
<smil>
<head>
<meta base="rtmp://localhost/bls_videos/_definst_" />
<layout>
<root-layout width="320" height="256" />
</layout>
</head>
<body>
<switch>
<video src="Bag-mask 1 resc (512)" system-bitrate="512000" />
<video src="Bag-mask 2 resc (512)" system-bitrate="128000" />
</switch>
</body>
</smil>
I can see in my server log for the bls_videos app that a connection is being made, but no streams are showing on the streams tab, and no response on the client. The following is logged on server when the connection is made:
welcome[object Client]
Error : command msg sent before client connection has been accepted.
Error : command msg sent before client connection has been accepted.
The Welcome is a trace line I put into the main.asc to ensure it was getting called. Not sure what the error is about.
Any more detailed information on using the SMIL XML files for streaming - particularly a fully worked end to end example, would be useful.After trawling through the various online and offline docs on this subject there is very little to guide anyone.
thanks
Nick
