0 Replies Latest reply on Jun 29, 2010 5:37 AM by coolvinu1980

    Video Fullscreen problem

    coolvinu1980

      I have done a Video chat application. I have added full screen options to all videos.My problem is on clicking the Fullscreen button, the Application will be in Fullscreen Mode not the video. How to solve this. Code is shown below

       

      In my Videopod component i have given like this

       

      private function fullScreen() :void
                   {
                      try {
                          switch ( Application. application. stage.displaySta te ) {
                              case  StageDisplayState. FULL_SCREEN:
                                  // switch to displayState = normal
                                  Application. application. stage.displaySta te = StageDisplayState. NORMAL;
                                  break;
                              default:
                                  //  switch to displayState = full
                                  Application. application. stage.displaySta te = StageDisplayState. FULL_SCREEN;
                                  break;
                          }
                      } catch ( e:SecurityError ) {
                          // ignore
                          Alert.show( "cannot go to  fullscreen mode. try setting: 'allowfullscreen = true' in HTML container", "security error" );
                      }
                      //setCorners( );
                       VideoChatEventsDisp atcher.getInstan ce().dispatchEve nt( new VideoChatEvent( VideoChatEvent. ON_FULLSCREEN_ CLICK, this ) );
                   }
              ]]>
          </mx:Script>
      <mx:Fade id="fadeIn" alphaFrom="0. 0" alphaTo="1.0" />  
      <mx:Fade id="fadeOut" alphaFrom="1. 0" alphaTo="0.0" />
          <mx:Canvas rollOver="showContr ols()" rollOut="hideContro ls()">
               <view:VideoContainer id="videoDisplay" width="200" height="170" />
              <mx:HBox  x="0" y="0" width="100%">
                  <mx:Label id="broadcastUserNa me"  color="#E8F4F6" fontSize="15" fontWeight=" bold" visible="false" />
              </mx:HBox>
              <mx:HBox id="controls" horizontalAlign= "right" styleName="controll erStyle"  width="100%" alpha="0.0" y="144" paddingRight= "5">
                  <mx:HSlider id="volumeSlider" x="59" y="142" width="103"
                      snapInterval= "1" value="50" maximum="100"
                       thumbDrag="updateVo lume(event) ;"  dataTipFormatFuncti on="formatVolume ToolTip"
                      liveDragging= "true" toolTip="Volume" />
                  <mx:Button id="muteButton" toolTip="Mute" height="20" width="20" styleName="mute" toggle="true"  click="toggleSound( )" x="170" y="142"/>
                  <mx:Button id="fScreenBut" click="fullScreen( )" styleName="fullscre en" toggle="true" height="30" width="35" toolTip="Fullscreen "/>
              </mx:HBox>
          </mx:Canvas>

       

       

       


      And in the main file i gave like this,

       


      private function fullScreen() :void
              {
                   Application. application. stage.addEventLi stener(  FullScreenEvent. FULL_SCREEN, fullScreenHandler );
                   //screenMode = Application. application. stage.displaySta te;
              }
             
               private function fullScreenHandler( e:FullScreenEvent ):void
               {
                      //screenMode = Application. application. stage.displaySta te + " ( fullScreen=" + e.fullScreen. toString( ) + ")";
                      if (e.fullScreen) {
                          // do stuff for full screen  mode
                         
                      } else {
                          // do stuff for normal screen mode
                      }
                  }