Sloopy Mike Gyamfi said the following:
Hi everybody,
I have succeeded in creating an application which acts more like a switcher.
It gets the list of all connected clients and resources.
You can preview and select a stream you'll like to send to the end
viewer. Acts more like a TV, the unicast approch
With red5 0.5 it works well and the serverStream sometimes plays till the end
With red5 0.6 the serverSttream stops after 5 secs. It buffers till
100% but starts falling. ofcource when it starts playing. Around 43%
buffer it stops and doesn't play no more.
The other problem I have is that, In red5 0.5, if I press the button
to make the switch, the current video plays till the end before the
new video switch takes place.
Here is the code at the serverside
public void switchStream(String streamName){
currentStreamName = streamName;
item.setStart(0);
item.setLength(10000);
item.setName(currentStreamName);
serverStream.addItem(item);
serverStream.start();
}
this code is called from the client side.
My question here is, is it a bug in the version 0.6 that makes the
video stop or is there something new I have to take care of ?
I assume you have an event handler on the button which could call a
method like below.
You essentially need to check if there is a current NetStream and if so
close it. Then create a new NetStream. I use this method allot whether
its the first time a stream is played or the user has switched to
another stream.
private function playStream():void {
var streamVideoURL:String = connectionUrl + "/" + videoURL;
streamVideoURL =videoURL;
if (stream != null){
stream.close();
}
stream = new NetStream(nc);
videoHolder = new UIComponent();
videoHolder.setActualSize(defaultWidth, defaultHeight);
video = new Video(defaultWidth, defaultHeight);
video.attachNetStream(stream);
stream.play(streamVideoURL);
stream.addEventListener(NetStatusEvent.NET_STATUS,
streamStatusHandler);
var client:Object = new Object();
client.onMetaData = onMetaData;
stream.client = client
}
How can I make the switch take place soon as I press the button
without the current stream first playing till the end ?
Help here will very much be appreciated. Thanks in adavance.
Sloopy
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org
--
/Whether you think that you can, or that you can't, you are usually right./
- Henry Ford
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org