0 Replies Latest reply on Jul 27, 2009 9:40 PM by Sreelash

    Problem with recording a live stream

    Sreelash Level 1

      An issue that occurs while recording is NetStream.Record.noAccess. This is occuring while the recorded video is placing on client's flash media server with the path that i specified above. But when i running it in the local flash media server(developer version), its working well. The recorded files are placed on live_test folder. In the client's server the stream is not recording, instead its showing  an error like "NetStream.Record.noAccess". The code that I am using for recording live stream is follows:

       

      stop();

       

      var nc = new NetConnection();
      var CommPage = 'http://68.233.8.57/videos/destination';
      System.security.allowDomain(CommPage);

       

      connect_pb.onRelease = function(){
          if(this.label == "Connect"){
              status_txt.text += "Connecting..." + newline;
              this.label = "Disconnect";
              nc.connect("rtmp://192.168.0.22/live_test")       
          } else {
              status_txt.text += "Disconnecting." + newline;
              this.label = "Connect";
              myvid.attachVideo(null);
              myvid.clear();
              ns.close();
              rec_ns.close();
          }
      }

       

      nc.onStatus = function(info) {
          status_txt.text += "NC.onStatus> info.code: " + info.code + newline;
          if (info.code == "NetConnection.Connect.Success") {
              status_txt.text = "Connected to " + this.uri + newline;
              startstop_pb.enabled = true;
              createNetStream(this);
              RecordNetStream(this);
          }
      }

       

      createNetStream = function(nc){
          ns = new NetStream(nc);
             
          ns.onStatus = function(info) {
              status_txt.text += "NS.onStatus> info.code: " + info.code + newline;
          }
          mycam = Camera.get();
          mycam.setQuality(25600, 0);
          mymic = Microphone.get();
          mymic.setRate(11);
          ns.attachVideo(mycam);
          ns.attachAudio(mymic);
          myvid.attachVideo(mycam);
          ns.publish("livevideo","live");   
      }

       

      RecordNetStream = function(nc){
          rec_ns = new NetStream(nc);
                 
          var xml_feed = new XML();
          xml_feed.onLoad = function(loaded) {
          };
         
          var dt1:Date = new Date();
         
          var dt0:String = String(dt1+":"+dt1.getTime());
          dt0 = dt0.split(' ').join('');
          dt0 = dt0.split(':').join('');
          dt0 = dt0.split('+').join('');//trace(dt0);
         
          var send_lv:LoadVars = new LoadVars();
          var RecordURL = CommPage+"?name="+dt0;
          send_lv.sendAndLoad(RecordURL, xml_feed, "POST");
         
          rec_cam = Camera.get();
          rec_cam.setQuality(25600,0);
          rec_mic = Microphone.get();
          rec_mic.setRate(11);
          rec_ns.attachVideo(rec_cam);
          rec_ns.attachAudio(rec_mic);
          rec_ns.publish(dt0,"record");   
      }

       

      Regards,

          Sreelash