Ask a Question related to Macromedia Flash Flashcom, Design and Development.

  1. #1

    Default NetStream problems

    I'm having a problem making the Tutorial_Record work properly.
    I tweaked the code a bit, and made it simple. Still, I have trouble with the
    recorded stream playback.

    To begin with, My stream is published ('live' stream is shown on the admin
    console), but not saved on the application folder. Why?

    Next, the Stream seems to trace no error, but doesn't play anything, even if I
    put in the directory a .flv from the sample_guestbook tutorial (that does
    work!).

    Here is the tracing of the netstream .play:

    Level: status Code: NetStream.Play.Reset
    clientid: 105793768
    details: my_recorded_stream
    description: Playing and resetting my_recorded_stream.
    code: NetStream.Play.Reset
    level: status
    Level: status Code: NetStream.Play.Stop
    reason:
    clientid: 105793768
    details: my_recorded_stream
    description: Stopped playing my_recorded_stream.
    code: NetStream.Play.Stop
    level: status
    Level: status Code: NetStream.Buffer.Flush
    level: status
    code: NetStream.Buffer.Flush

    Any help appreciated.

    I've tried changing the security setting to Network/Local Only but there was
    no change in the results.

    Here's the client-code, put in keyframe 1, layer 1 (lowest):


    var my_video:Video; //my_video is a Video object on the Stage
    var her_video:Video; // "her" = example already recorded video object
    var my_cam:Camera = Camera.get();
    var my_mic:Microphone = Microphone.get();

    my_video.attachVideo(my_cam);


    record_btn.addEventListener("click",doRecord);
    play_btn.addEventListener("click",doPlay);



    function initStreams() {

    // Make a connection to the application on the server
    client_nc = new NetConnection();

    // Note that this call includes the protocol, rtmp, the
    // app name, tutorial_record, and the application instance name, room_01
    client_nc.connect("rtmp://localhost/dev3video");

    // Handle status message for the
    client_nc.onStatus = function(info) {
    trace("Level: " + info.level + " Code: " + info.code);
    }

    // Create output stream used to publish the video
    out_ns = new NetStream(client_nc);

    // Create an input stream to playback the video, and attach
    // video on that stream to the Replay_video object
    in_ns = new NetStream(client_nc);

    in_ns.onStatus = function(info) {
    trace("Level: " + info.level + " Code: " + info.code);
    //trace("NetStream.onStatus called: ("+getTimer()+" ms)");
    for (var prop in info) {
    trace("\t"+prop+":\t"+info[prop]);
    }
    }

    her_video.attachVideo(in_ns);
    }



    // Connect to server and set up streams
    initStreams();


    function doRecord() {

    if (record_btn.label == "Record") {
    //Record_btn.selected
    //was: Record_btn.getLabel() == "Record"
    trace ("You pressed Record");
    // Attach data from the video and audio devices to the output stream
    out_ns.attachVideo(client_cam);
    out_ns.attachAudio(client_mic);

    // Then publish the camera output as a recorded stream
    out_ns.publish("my_recorded_stream", "record");

    // Don't allow the user to play when recording
    play_btn.enabled = false;

    // Change the button label
    record_btn.label = "Stop";

    } else if (record_btn.label == "Stop") {
    trace ("You pressed (STOP-)Record");
    // Close output stream.
    //? why doesn't it save the stream in the applications folder?
    out_ns.close();

    // Now that you're finished recording, allow the user to play
    play_btn.enabled = true;
    record_btn.label = "Record";
    }
    }

    function doPlay () {
    trace ("You pressed Play");
    in_ns.play("my_recorded_stream");

    }




    Tal_CS Guest

  2. Similar Questions and Discussions

    1. NetStream in Flex SDK
      HI I have a clinet and a server side WebCam applictions that is developted in Flex builder 3 and on top of Flash Media Server . in server side I...
    2. NetStream.Play.Stop/NetStream.Buffer.Flush calledprematurely
      So I've created a custom video interface (based on the one http://movielibrary.lynda.com/html/modPage.asp?ID=182 ) that hinges on the...
    3. netStream information plz
      the following code is a netStream on status if function however if i change createNetStream(this); to createNetStream(_root) or...
    4. Saving a NetStream to FLV
      Hi Everyone, I am a relative Flash newbie and have been trying to accomplish the following: I want to know how to save video and audio content...
    5. NetStream not streaming
      hey everybody! :) the first chapter of the oreilly fcs book has a helloVideo app that works. it's pretty much what i want to do with my app so...
  3. #2

    Default Re: NetStream problems

    Quote Originally Posted by Tal_CS View Post
    I'm having a problem making the Tutorial_Record work properly.
    I tweaked the code a bit, and made it simple. Still, I have trouble with the
    recorded stream playback.

    To begin with, My stream is published ('live' stream is shown on the admin
    console), but not saved on the application folder. Why?

    Next, the Stream seems to trace no error, but doesn't play anything, even if I
    put in the directory a .flv from the sample_guestbook tutorial (that does
    work!).

    Here is the tracing of the netstream .play:

    Level: status Code: NetStream.Play.Reset
    clientid: 105793768
    details: my_recorded_stream
    description: Playing and resetting my_recorded_stream.
    code: NetStream.Play.Reset
    level: status
    Level: status Code: NetStream.Play.Stop
    reason:
    clientid: 105793768
    details: my_recorded_stream
    description: Stopped playing my_recorded_stream.
    code: NetStream.Play.Stop
    level: status
    Level: status Code: NetStream.Buffer.Flush
    level: status
    code: NetStream.Buffer.Flush

    Any help appreciated.

    I've tried changing the security setting to Network/Local Only but there was
    no change in the results.

    Here's the client-code, put in keyframe 1, layer 1 (lowest):


    var my_video:Video; //my_video is a Video object on the Stage
    var her_video:Video; // "her" = example already recorded video object
    var my_cam:Camera = Camera.get();
    var my_mic:Microphone = Microphone.get();

    my_video.attachVideo(my_cam);


    record_btn.addEventListener("click",doRecord);
    play_btn.addEventListener("click",doPlay);



    function initStreams() {

    // Make a connection to the application on the server
    client_nc = new NetConnection();

    // Note that this call includes the protocol, rtmp, the
    // app name, tutorial_record, and the application instance name, room_01
    client_nc.connect("rtmp://localhost/dev3video");

    // Handle status message for the
    client_nc.onStatus = function(info) {
    trace("Level: " + info.level + " Code: " + info.code);
    }

    // Create output stream used to publish the video
    out_ns = new NetStream(client_nc);

    // Create an input stream to playback the video, and attach
    // video on that stream to the Replay_video object
    in_ns = new NetStream(client_nc);

    in_ns.onStatus = function(info) {
    trace("Level: " + info.level + " Code: " + info.code);
    //trace("NetStream.onStatus called: ("+getTimer()+" ms)");
    for (var prop in info) {
    trace("\t"+prop+":\t"+info[prop]);
    }
    }

    her_video.attachVideo(in_ns);
    }



    // Connect to server and set up streams
    initStreams();


    function doRecord() {

    if (record_btn.label == "Record") {
    //Record_btn.selected
    //was: Record_btn.getLabel() == "Record"
    trace ("You pressed Record");
    // Attach data from the video and audio devices to the output stream
    out_ns.attachVideo(client_cam);
    out_ns.attachAudio(client_mic);

    // Then publish the camera output as a recorded stream
    out_ns.publish("my_recorded_stream", "record");

    // Don't allow the user to play when recording
    play_btn.enabled = false;

    // Change the button label
    record_btn.label = "Stop";

    } else if (record_btn.label == "Stop") {
    trace ("You pressed (STOP-)Record");
    // Close output stream.
    //? why doesn't it save the stream in the applications folder?
    out_ns.close();

    // Now that you're finished recording, allow the user to play
    play_btn.enabled = true;
    record_btn.label = "Record";
    }
    }

    function doPlay () {
    trace ("You pressed Play");
    in_ns.play("my_recorded_stream");

    }
    I'm not pretty sure, but in documentation says that method 'close' in net stream delete the file or somethinh like that. And i don't know the solution too...
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139