8 Replies Latest reply on Oct 7, 2009 3:15 PM by chadillac83

    Flex 3 Video problems

    chadillac83

      Short Version:

      Wrote a video chat application... works fine for 95% of our community.  Other 5% are experiencing video problems... they can't see their own video in a Video object nor can they see other users streams.  I'm stumped... thought it might be video encoding issues but users can see themselves via their web cam from the "Settings..." panel making me think that if the app can encode the vid in the settings panel I'm guessing it should be able to do it in the app. They also can't view video coming from other users via FMS.

       

      Long Version:

      Users for the most part are able to jump into the app without issue but a handful of people (maybe 150 give a few take a few) are reporting issues with Video both locally and streaming.  They say they can see their video from the "Settings..." panel but when they try to start their stream it fails to not only start publishing their stream but also it fails to show them their local preview (flash.media.Video -> Video.attachCamera(Camera.getCamera())) which doesn't make any sense considering they can see it in the "Settings..." panel and have also set their permissions to "Allow".  As if that wasn't confusing and quarky enough the same users report no video coming back out of the FMS3 server.  Some report being able to hear audio but no video.

       

      So it's safe to say the streams coming from the server are working as expected since we do have reports of audio coming over the line but no vid.  Also this is a multi-user chat room application so other users will be able to see the video and confirm it's working properly for them (another reason I don't think it's the App source or the server).  Basically after digging through tons of pointlessness via Google I've yet to find someone complaining about the same issue (which is usually a bad sign ::sigh::) and I'm hoping someone has experienced something similiar that could shed some light.

       

      All feedback and ideas are welcomed... no seriously... I've run out of ideas.  I can provide some source code and such as needed.

       

      To start off this is our GenericVideo class (VideoDisplay = 1 NetC per NetS so we rolled our own)

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initComponent()">
          <mx:Script>
              <![CDATA[
             
                  import flash.media.Video;
                  import flash.media.SoundTransform;
                  import mx.core.UIComponent;
                  import mx.core.Application;
                 
                  public var UIComp:UIComponent;
                  public var video:Video;
                  public var webcam:Boolean;
                  public var hideVideo:Boolean;
                  public var netStream:NetStream;
                  public var streamId:String;
                 
                  private var _audio:SoundTransform;
                  private var _webCam:Camera;
                  private var _attached:Boolean;
                 
             
                  private function initComponent():void
                  {
                      UIComp = new UIComponent();
                     
                      this.video = new Video(this.height, this.width);
                     
                      this.video.width = this.width;
                      this.video.height = this.height;
                      this.video.smoothing = true;
                     
                      UIComp.addChild(this.video);
                     
                      this.addChild(UIComp);
                     
                      if(webcam == true)
                      {
                          if(hideVideo)
                          {
                              video.visible = false;
                          }
                      }
                  }
                 
                  public function clear():void
                  {
                      // broken... don't even bother using it... use clear_hack() instead.
                      this.video.clear();
                  }
                 
                  public function clear_hack():void
                  {
                      // as3 video.clear() = broken... this is a hack. - Chad
                      UIComp.removeChild(this.video);
                     
                      this.video = new Video(this.height, this.width);
                     
                      this.video.width = this.width;
                      this.video.height = this.height;
                      this.video.smoothing = true;
                     
                      UIComp.addChild(this.video);
                     
                      if(webcam == true)
                      {
                          if(hideVideo)
                          {
                              video.visible = false;
                          }
                      }
                  }
                 
                  public function attachMyCamera():void
                  {
                      _webCam = Camera.getCamera();
                      //_webCam.setQuality( 0, 0);
                      //_webCam.setMode(this.width, this.height, 20);
                     
                      this.video.attachCamera(_webCam);
                  }
                 
                  public function openStream(duid:String):void
                  {
                      if(this.netStream)
                      {
                          closeStream();
                          this.netStream = null;
                          this._audio = null;
                      }
                     
                      clear_hack();
                     
                      if(duid != 'true')
                      {
                          this.streamId = duid;
                      }
                     
                      this.netStream = new NetStream(Application.application.stream);
                      this.netStream.addEventListener(NetStatusEvent.NET_STATUS, handleNetStatus);
                      this.netStream.play(this.streamId);
                     
                      this._audio = new SoundTransform(0,0);
                      this.netStream.soundTransform = this._audio;
                     
                      this.video.attachNetStream(this.netStream);
                      this.video.visible = true;
                      this._attached = true;
                  }
                 
                  public function handleNetStatus(event:NetStatusEvent):void
                  {
                      //Alert.show(event.info.code.toString());
                  }
                 
                  public function closeStream():void
                  {
                      if(this.netStream)
                      {
                          this.netStream.soundTransform = null;
                          this._audio = null;
                          this.netStream.close();
                      }
                     
                      if(this.video)
                      {
                          this.video.visible = false;
                      }
                  }
                 
                  public function set setVolume(soundValue:Number):void
                  {
                      var audio:SoundTransform = this.netStream.soundTransform;
                      audio.volume = soundValue;
                         
                      this.netStream.soundTransform = audio;
                  }
                 
                  public function set setAttached(isAttached:Boolean):void
                  {
                       if(isAttached)
                       {
                           this.video.attachNetStream(this.netStream);
                       }
                       else
                       {
                           this.video.attachNetStream(null);
                       }
                      
                       this._attached = isAttached;
                  }
                 
                  public function get attached():Boolean
                  {
                       return this._attached;
                  }
                 
              ]]>
          </mx:Script>
      </mx:Canvas>

       

       

      P.S. this is my first Flex Application... so bear with me if it's kinda sloppy.

        • 1. Re: Flex 3 Video problems
          chadillac83 Level 1

          bump

          • 2. Re: Flex 3 Video problems
            chadillac83 Level 1

            thanks for nothing

            • 3. Re: Flex 3 Video problems
              Gregory Lafrance Level 6

              Have you identified any differences at all on the machines of the users who are experiencing issues, like what OS, what browser, what connection speed, stc.

              • 4. Re: Flex 3 Video problems
                chadillac83 Level 1

                I've put together http://socialcase.com/dia/main.html to try and get an idea of their systems but I'm still awaiting responses from most of them.  What I do know from talking to them is they're running Windows and the lastest version of the Flash player 10,0,22,87 (if I recall).  I'm going to build out the Diagnostics App some more today that will do a few tests of their capabilities and report them back to me so I can hopefully get a better idea of how their systems are config'd.

                 

                I'm anxious to see if the users reporting video issues Flash players report Video/Audio Streaming as enabled and if they have the Video Encoder in Capabilities.  I don't know how they would have a vanilla flash player install without it... but we'll just have to wait and see I guess.

                 

                (thanks for the reply btw... was starting to think this place was a ghost town)

                • 5. Re: Flex 3 Video problems
                  chadillac83 Level 1

                  here is a system profile from one of our users reporting video issues...it's strange because his cam seems to work fine in this app, and on another section of the site where we show a grid of users on cam he says he can view that video fine as well... I'll be crawling over the source code and trying to figure out where something could possibly be breaking in hopes of finding something...

                   

                  -- USER CAMERA FEEDBACK TEST RESULTS --
                  User confirmed their cam worked
                  -- END USER CAMERA FEEDBACK TEST RESULTS --

                  -- CAMERA TEST RESULTS --
                  Camera Successfully Used!
                  Camera Used: Logitech QuickCam Communicate STX
                  Cameras Available: Logitech QuickCam Communicate STX
                  -- END CAMERA TEST RESULTS --

                  -- MICROPHONE TEST RESULTS --
                  Microphone Successfully Used!
                  Microphone Used: Logitech Mic (Communicate STX)
                  Microphones Available: Logitech Mic (Communicate
                  STX),Modem #0 Line Record,SoundMAX Digital Audio
                  -- END MICROPHONE TEST RESULTS --

                  -- CAPABILITIES TEST RESULTS --
                  AV Disabled: false
                  Accessability: true
                  Has Audio: true
                  Audio Encoder: true
                  Embedded Video: true
                  IME: true
                  MP3 playback: true
                  Printing: true
                  Screen Broadcasting: false
                  Screen Playback: false
                  Streaming Audio: true
                  Streaming Video: true
                  TLS: true
                  Video Encoder: true
                  Debugger: false
                  Language: en
                  Local File Read Disabled: false
                  -- END CAPABILITIES TEST RESULTS --

                  -- SYSTEM INFORMATION TEST RESULTS --
                  Manufacturer: Adobe Windows
                  OS: Windows XP
                  Aspect Ratio: 1
                  Player Type: ActiveX
                  Color Screen: color
                  Screen DPI: 72
                  Resolution X: 1440
                  Resolution Y: 900
                  Version: WIN 10,0,22,87
                  -- END SYSTEM INFORMATION TEST RESULTS --                       
                  • 6. Re: Flex 3 Video problems
                    chadillac83 Level 1

                    users tested using the client without the video_clear_hack and still having no luck...

                     

                    anyone have ANY ideas?

                    • 7. Re: Flex 3 Video problems
                      richbtee

                      I would say its a firewall issue.

                      Get them to run the tests here http://www.flashcomguru.com/apps/port_test/index.cfm.

                       

                      public function openStream(duid:String):void
                                  {
                                      if(this.netStream)
                                      {
                                          closeStream();
                                          this.netStream = null;
                                          this._audio = null;
                                      }
                                     
                                      clear_hack();
                                     
                                      if(duid != 'true')
                                      {
                                          this.streamId = duid;
                                      }
                                     
                                      this.netStream = new NetStream(Application.application.stream);
                                      this.netStream.addEventListener(NetStatusEvent.NET_STATUS, handleNetStatus);
                                      this.netStream.play(this.streamId);
                                     
                                      this._audio = new SoundTransform(0,0);
                                      this.netStream.soundTransform = this._audio;
                                     
                                      this.video.attachNetStream(this.netStream);
                                      this.video.visible = true;
                                      this._attached = true;
                                  }

                       

                       

                      It looks like your creating the NetConnection in your main app file, or at least storing it there.

                      At the point your open stream method is called, it looks like your video visibile property is set to false and doesnt get set to true until you play the stream.  If the user can't see the stream this will throw an error and so the videos visible property will never be set to true.

                      • 8. Re: Flex 3 Video problems
                        chadillac83 Level 1

                        Thanks for the help I'll def. have some users check out that link and hopefully shed some more light on this issue.  We haven't had this complaint recently after making some changes the overall connection logic of the parent connections.  We now have the video displays check the connection before attempting to stream from it.  If the connection isn't up and usable we have the video component attempt to reestablish the connection (5 attempts then fail) if the connection succeeds we use it.  If not we inform the user that we're unable to connect to the server and we're sorry but their video feeds won't work.

                         

                        As far as the video components visible state is concerned it overlays the UI.  Basically if they can't connect to the video they still see a loading message until we successfully connect.  This is why the video stays visiblity=false until we deem it ready to view.

                         

                        Once again thanks for the suggestions and it's appriciated.

                         

                        Attached is an awesome gif that should make you laugh in exchange for your advice