2 Replies Latest reply on Aug 2, 2007 8:10 AM by funkysoul

    problem with soundObject/video.... please help!

    hyper_happy
      hi guys,

      I created a FLV player that worked pretty well (play, pause, audio controls, scrubber). However, I implemented the dynamic bandwidth detection ( http://www.adobe.com/devnet/flashco..._bandwidth.html) and had to make a few tweaks to my player but now my audio controls don't work and neither does my scrubber! Here's the code I am using to connect to the stream:

      =======

      nc = new NetConnection();
      nc.onStatus = function(info) {
      trace("Level: "+info.level+" Code: "+info.code);
      if (info.code == "NetConnection.Connect.Success") {
      trace("--- connected to: " + this.uri);
      initStream();
      }
      };
      nc.connect("rtmp://...."); // URL to stream

      initStream = function(){
      if(detected_bw >= 256){
      useVideo = "256kbps_Stream";
      bufferlength = 2;
      } else if (detected_bw <256 && detected_bw >=100){
      useVideo = "100kbps_Stream";
      bufferlength = 3;
      } else {
      // bandwidth is too low, you best alert the user at this stage or load an alternative, very low bandwidth clip
      trace("bandwidth too low");
      // take action here
      }
      // create a netstream
      ns = new NetStream(nc);
      // optional onStatus handler
      ns.onStatus = function(info) {
      trace("Level: " + info.level + " Code: " + info.code);
      };
      ns.setBufferTime(bufferlength);
      // attach the Netstream to a video object called videoDisplay on stage
      videoDisplay.attachVideo(ns);
      ns.connect(useVideo);
      }
      stop();

      ======

      Here's the code I am using to control the audio (which used to work but isn't working now):

      _root.createEmptyMovieClip("vSound", _root.getNextHighestDepth());
      vSound.attachAudio(ns);
      var so:Sound = new Sound(vSound);

      so.setVolume(50);
      volBarsOver_mc.gotoAndStop(6);

      // unmute button action
      unmute.onPress = function() {
      so.setVolume(50);
      volBarsOver_mc.gotoAndStop(6);
      mute._visible = true;
      this._visible = false;
      };


      // mute button actionv
      mute.onPress = function() {
      so.setVolume(0);
      volBarsOver_mc.gotoAndStop(1);
      unmute._visible = true;
      this._visible = false;
      };

      ======

      ANY help would be greatly appreciated as I am confused as to why it stopped working....!!! This is very frustrating!

      Thank you.