Question
End of streaming file
Hello,
I've two problems with the streaming from a flv-file from a FMS2.
First, when I stop the stream (pause) and want to restart it i have a small jump in the stream.
Second, how can I detecting the end of the stream/file?
Here is my code:
import mx.controls.*;
var stream_wnd:Video;
var stream:String="water"; //File
var fms:String="rtmp://192.168.1.1/Video_1/video"; //FMS2
var telegramm_btn:Button;
var play_btn:Button;
var status_stream:Boolean=false;
var endTime:Number;
var nc:NetConnection = new NetConnection();
stop();
nc.connect(fms);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(2);
this.stream_wnd.attachVideo(ns);
this.play_btn.onRelease = function(){
if (status_stream){
ns.pause();
}
else {
play_btn._visible = false;
ns.play(stream);
status_stream=true;
}
};
this.pause_btn.onRelease = function(){
ns.pause();
};
this.back_btn.onRelease = function(){
ns.seek(1);
};
I've two problems with the streaming from a flv-file from a FMS2.
First, when I stop the stream (pause) and want to restart it i have a small jump in the stream.
Second, how can I detecting the end of the stream/file?
Here is my code:
import mx.controls.*;
var stream_wnd:Video;
var stream:String="water"; //File
var fms:String="rtmp://192.168.1.1/Video_1/video"; //FMS2
var telegramm_btn:Button;
var play_btn:Button;
var status_stream:Boolean=false;
var endTime:Number;
var nc:NetConnection = new NetConnection();
stop();
nc.connect(fms);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(2);
this.stream_wnd.attachVideo(ns);
this.play_btn.onRelease = function(){
if (status_stream){
ns.pause();
}
else {
play_btn._visible = false;
ns.play(stream);
status_stream=true;
}
};
this.pause_btn.onRelease = function(){
ns.pause();
};
this.back_btn.onRelease = function(){
ns.seek(1);
};
