Cancel a net stream to fms server from flex
Is there a way to cancel a netstream publish from flex to a flash media server?
The issue is I have code wher开发者_如何转开发e I can Start/Stop a recording to my Flash media server. However in my front end I have a cancel button which allows the user to cancel the current recording and all this code essentially does it close the netstream. But the issue is it still creates the file on my flash media server even though the user has canceled the stream. Is there a function that I can call that will clear up the stream and remove the file that was created?
Thanks
The thing is that FMS records the stream to the disk while it's being streamed. So when you call netStream.close(), it just stops recording data.
AFAIK, there is no way to remove stream as a stream, but each recorded stream is stored in a file, so
you can manually remove the file from the server using server-side script and file.remove()
there.
If you use Flash Media Streaming Server (which means you cannot modify FMS server-side scripts), then use some scripting language such as Python or PHP to do file removing job.
精彩评论