On Mon, Apr 16, 2007 at 04:32:22PM +0100, Adam wrote:
> Been having trouble with Seek() called on any stream
> with audio. Basically, the very first time I call
> seek() after a play() it seems to work, but subsequent
> seek()s fail. The stream stops, either Red5 nor Flash
> seem to report any error. It all just stops.
>
> Other streams on the same connection drop too. Fails
> on at least the two Mac's i've got here.
>
> Can anyone confirm it fails for them too? Just need to
> paste this into an empty movie:
Whoops. The connect() function wouldn't actually
connect there withhout the right webapp directory
installed. This one should work (and then show the
problem) better if anyone has any clues:
//----------------------------------------------------------
//Global to track frame-number so we know when to do things
var ticker=0;
//Set up a new net connection
_root.nc = new NetConnection();
_root.nc.onStatus = ncStatus;
_root.nc.connect("rtmp://localhost/test");
//Function to print netstream status
function ncStatus(info){
trace("Status:"+info.level+":"+info.code);
}
//Set up a stream to record audio
_root.ns = new NetStream(_root.nc); //Record stream
_root.pns = new NetStream(_root.nc); //Playback stream
this.onEnterFrame=function(){
ticker++;
if(ticker==10){
//Record a sound
trace("Recording...");
_root.ns.attachAudio(Microphone.get());
_root.ns.publish("AudioTest","record");
}
if(ticker==210){
//Stop recording
trace("Stopping Recording...");
_root.ns.publish(false);
}
if(ticker==260){
//Start a playback
trace("Playing Back");
_root.attachAudio(_root.pns);
_root.pns.play("AudioTest");
}
if((ticker>300)&&(ticker%100==0)){
//Seek to a position early in the track
trace("Seeking In Recording");
_root.pns.seek(1);
}
}
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org