I am almost at my witsend here. I am a programmer so Im not a novice at computers. I have spent four hours here trying sifting through the forums and documentation to get things working on 2 different computers and no joy whatsoever. I have got more instructions and examples from ?30 software I have bought. Here is the situation In the infamous applications directory I have a folder called my_app applications\my_app\ applications\my_app\scripts\ ( the main.asc and the components.asc ) applications\my_app\test ( the _definst_ folder ) applications\my_app\test\_definst_\ ( the test.flv ) Problem 1 i have ran about a hundred variations of the folder layouts and the stream never appears in the console under the test instance Problem 2 In the client swf I have two layers, one with the script my_con = new NetConnection(); my_con.connect("rtmp://localhost:1935/my_app/test/_definst_/test.flv"); ( Have also done a hundred variations on this too ) and a second layer with the video object. I hit F12 to publish preview and I get an alert telling me the player is trying to access an internet enabled location and then a blank page I check the console to see if there has been any connection from a client and no, never, nada.... I have my firewall turned off, done a netstat and its listening to the port, pinged it, restarted the flash server oh and done all this again on a different computer. Now, Im not one to moan, but after paying such a hefty fee and expecting things to work, I am not impressed when I have to spend hours trying to get the thing to do what I paid for it to do. I am not impressed with Macromedia or Adobe and would like some constructive help on sorting all of my issues, after ?4900 should pay for a bit of support. Regards Tony
First off, your directory structure should look like this: Your asc files: applications\my_app\main.asc Your video files applications\my_app\streams\[app instance]\myVideo.flv About the [app instance]... FMS has the ability to create separate instances of the same application. When you don't specify an instance name (more on that below), FMS connects to the default instance, and names it _definst_ . when you make your netconnection, you're just connecting to the application instance, not the video stream. Your connection string will look like this: my_con.connect("rtmp://localhost:1935/my_app/test); In this example, you're connecting to an an instance of my_app, with an instance name of test. Once you have established your netconnection, you then create a netstream to play your video, like so: my_ns = new NetStream(my_con); my_video_object.attachVideo(my_ns); my_ns.play([streamName]); The value of [streamName] will be the name of your flv, without the flv extension. Since we've defined an instance name (test), the path to the flv will look like this: applications\my_app\streams\test\myVideo.flv If we didn't define an instance name (meaning we want to use the default instance) the video would be here: applications\my_app\streams\_definst_\myVideo.flv The examples here doing include any status handlers for the netconnection and the netstream, which you'll want to add. Typically, you'll want to wait for the onstatus event from the netconnection before you create the netsream. Without those event handlers, your client app can't respond to errors or failures. All of that is covered in the docs. About the console... you won't see any streams listed until a client connects to a stream. The console lists active streams, not recorded files. When a client connects, you'll see two entires show up in the list. One is the server playing the recorded file, and the other is the stream being published to the client. Hope that clears things up a bit.
Thank you for your reply and help, I really appreciate it. Done exactly what was said here. Deleted all the directories. Put the main.asc in applications\my_app\main.asc Put my video in applications\my_app\streams\test\abc.flv Here is my client code my_con = new NetConnection(); my_con.connect("rtmp://localhost:1935/my_app/test"); my_ns = new NetStream(my_con); video1.attachVideo(my_ns); my_ns.play("applications\my_app\streams\test\abc", 0, 1); my_ns.play("applications\my_app\streams\test\_definst_\abc.flv", 0, 1) created that directory All times, no clients in console and no streams showing, no stream plays in client As I was saying, I have tried an unmerciful amount of variations on the file structure and the client connection url, I am almost giving up. Gues what, no again Tried variations of the my_ns.play("abc", 0, 1); my_ns.play("appliabc", 0, 1);
Don't define the name of the streams dir in your ns.play arguments... just use the stream name. Change this: my_ns.play("applications\my_app\streams\test\abc", 0, 1); to this: my_ns.play("abc", 0, 1); And you should be in good shape
Thanks again for your reply but im afraid that makes no difference either.
Guys I sorted this, at last. Guess what it is. As I was being lazy with the flash and hitting f12 which gives a publish preview, it was launching the swf in the browser with its file path so something like this file:///C:/Inetpub/wwwroot/flash_files/my_app2.html That is where the problem lay, it should have been http://localhost/flash_files/my_app2.html Well hey, im gonna eat my santy hat now. Now I need to go off and discover how to set up different bandwidth streams. Does the server actually determine the connection speed or do I have to write some stuff for that? Happy Christmas
Don't see what you're looking for? Try a search.
|