PDA

View Full Version : stop stream command?


em el
11-03-2006, 03:14 PM
Does anyone know if there is any action script that can stop a streaming FLV and free up the thread?

I have a large streaming video on one of our pages of our website and would like to tie in a javascript command to send a command to the SWF to somehow do a stop stream.

thanks

Syllogism
11-03-2006, 03:36 PM
are you streaming the file with streaming server software or is it just a file on the server?

silentweed
11-03-2006, 03:37 PM
you using netsteam, net connection objects etc? To free up the stream ..just try playing a non-existent flv e.g

ns.play("nonexistent.flv");

em el
11-03-2006, 03:45 PM
are you streaming the file with streaming server software or is it just a file on the server?

Right now I am just streaming a file on the server. My SWF loads a FLV in and controlling that with the canned FLVplayback component.

em el
11-03-2006, 03:52 PM
you using netsteam, net connection objects etc? To free up the stream ..just try playing a non-existent flv e.g

ns.play("nonexistent.flv");

Honestly, I am kind of a novice at AS coding and FLVs in general. I am not explictly using anything beyond the canned FLVplayback component, so if this component uses netstream or net connection objects then I am but otherwise I am not.

so, in theory, I could attach a that ns.play command to an event to stop the stream? is there an ns.stop command?

Syllogism
11-03-2006, 04:17 PM
well in that case I recommend you check out www.gotoandlearn.com and check out the video basics movies.

em el
11-03-2006, 04:53 PM
well in that case I recommend you check out www.gotoandlearn.com and check out the video basics movies.
well based on what i've read here, here is a solution (obviously i'd still have to add movie controls etc)

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myVideo.attachVideo(ns);
ns.play("whatever-my-url-is.flv");
//button
mainarea_mc.onRelease = function() {
ns.play("nonexistent.flv");
};

It seems like there should be a more sussinct way to stop the ns than to trick it with a failed load.

Any thoughts?

Syllogism
11-03-2006, 05:40 PM
ns.close()

should do the trick?

CyanBlue
11-03-2006, 06:31 PM
I think ns.close() should work as long as you are streaming via FMS... If you are merely tricking as if you are streaming by simple HTTP protocol, it won't do the job right because HTTP tunnel is still open even if you use ns.close() function... The HTTP tunnel will eventually close after certain period, but it won't be as quick...

Syllogism
11-03-2006, 06:41 PM
They don't call him the Super Moderator for nothing.

em el
11-03-2006, 07:04 PM
I think ns.close() should work as long as you are streaming via FMS... If you are merely tricking as if you are streaming by simple HTTP protocol, it won't do the job right because HTTP tunnel is still open even if you use ns.close() function... The HTTP tunnel will eventually close after certain period, but it won't be as quick...

Ah thanks. Though I just tested it on our server and the ns.close() worked pretty good (much better than before) and I am not on a FMS. Now my next step is to try and set up javascript that sends inside the SWF a var so I can listen for it and close the ns and be faster to respond to the html navigation request.

Like I said before I'm a newb, anyone have advice or tutorials to send data into flash?

(thanks for all the other help too) :D

Syllogism
11-03-2006, 09:36 PM
I'd start a new thread if I were u. Also check out FScommand.