I have been trying to play multiple .flv by ising a playlist or even through the FLVPlayback Component Behaviors or via .xml or smil file.
I can get the player to play a single video but not work with .xml nor evein in Flash's preset behavior file lists. I have followed thier tutoral several times and the videos will not play (http://www.macromedia.com/devnet/fla...aviors_05.html)
Would anyone have a complete example of this playback script or even a smil file that streams one clip and then the next and so on.
This is the code I have been using for the AS:
PHP Code:
on (buffering) {
// Set Videos Behavior
// Create a videos object to hold a video
// playlist and event handler functions...
var videos:Object = new Object();
// Set up to 7 video feeds in a single component
videos.list = new Array();
videos.list[0] = "streams/DaveAugie_001.flv";
videos.list[1] = "streams/DaveAugie_002.flv";
videos.list[2] = "";
videos.list[3] = "";
videos.list[4] = "";
videos.list[5] = "";
videos.list[6] = "";
videos.loop = false;
videos.length = 1;
videos.loaded = false;
// Path to FLVPlayback components
var m = this.myVideo;
// Set the path of the first video feed
m.contentPath = videos.list[0];
// Set a 'ready' event handler to load the videos
videos.ready = function( evt:Object ):Void
{
if(!this.loaded){
this.loaded = true;
for( var n=1; n<this.list.length; n++ ){
if( videos.list[n].indexOf(".flv") != -1 ){
m.activeVideoPlayerIndex = n;
m.contentPath = videos.list[n];
this.length++;
}
}
m.activeVideoPlayerIndex = 0;
}
}
m.addEventListener("ready",videos);
// Set a 'complete' event handler to load the next video
videos.complete = function( evt:Object ):Void
{
var nextIndex = Number(evt.vp)+1;
if( nextIndex == this.length){
if( this.loop ){
nextIndex = 0;
}else{
return;
}
}
m.activeVideoPlayerIndex = nextIndex;
m.visibleVideoPlayerIndex = nextIndex;
m.play();
}
m.addEventListener("complete",videos);
// End Set Videos Behavior
// Stop and Reset Behavior
this.myVideo.autoRewind = true;
this.myVideo.stop();
// End Stop and Reset Behavior
// Start Toggle Play/Pause Behavior
var m = this.myVideo;
if(!m.playing)
{
if(Math.round(m.playheadTime) == m.totalTime)
m.stop();
m.play();
}else{
m.pause();
}
// End Toggle Play/Pause Behavior
// Set Video Index Behavior
this.myVideo.stop();
this.myVideo.activeVideoPlayerIndex = 0;
this.myVideo.visibleVideoPlayerIndex = 0;
this.myVideo.play();
// End Set Video Index Behavior
}
Smil file
HTML Code:
<smil>
<head>
<layout>
<root-layout width="720" height="480" />
</layout>
</head>
<body>
<switch>
<ref src="streams/DaveAugie_001.flv" dur="7:15.1"/>
<ref src="streams/DaveAugie_002.flv" dur="6:34.1"/>
</switch>
</body>
</smil>
xml
HTML Code:
<xml>
<listitem name="Dave Augie Pt 1" url="DaveAugie_001.flv">
<stream name="DaveAugie" start="0" len="-1"/>
</listitem>
<listitem name="Dave Augie Pt 2" url="DaveAugie_002.flv">
<stream name="DaveAugie2" start="0" len="-1"/>
</listitem>
<menu>
<listitem name="Dave Augie Pt 1"/>
<listitem name="Dave Augie Pt 2"/>
</menu>
</xml>
I would like at least one of these to work to stream multiple streams.
here is what I have done so far using the FLVPlayback Component:
http://www.wirestreamnetwork.com/test/player.html