15 Replies Latest reply: Jun 5, 2011 8:40 AM by kglad RSS

    FLV fullscreen problem

    Petteri_Paananen Community Member

      Hi again...=)

       

      I have a problem....again. Maybe someone can help me out with this.

       

      Little background:

      I have a main.swf inside html-wrapper. I load some external SWFs into it. Sometimes there is a FLV-video included into a SWF, sometimes not. Those external SWFs comes actually from an automated process, so I don´t have acces to any source codes of them, and I have no clue about instance names of any objects etc...

       

      Problem:

      Theres a fullscreen button in main.swf. It works perfectly if I use it with external SWF without FLV. But if I try to use it with external SWF with FLV video takes over the screen and all the other graphics etc. disappears.

       

      I´m looking for a solution to disable that fullscreen for FLV, but I still want my main.swf to go fullscreen... I know that I could use myFLVplayer.fullScreenTakeOver = false if I just knew the instance name of that FLV-player... but I don´t. And I actually doubt that it keeps changin all the time in a process that creates those SWFs, so there´s not much use to know how it is named in one SWF, name is probably totally different in another...

        • 1. Re: FLV fullscreen problem
          kglad CommunityMVP

          pass the content of your loader (after loading is complete and cast as a movieclip) to the below function:

           

          function flvTakeOverDisableF(mc:MovieClip){
              for(var i:uint=0;i<mc.numChildren;i++){
                  if(mc.getChildAt(i) is FLVPlayback){
                      FLVPlayback(mc.getChildAt(i)).fullScreenTakeOver = false;
                      break;
                  } else if(mc.getChildAt(i) is MovieClip){
                      flvTakeOverDisableF(MovieClip(mc.getChildAt(i)));
                  }
              }
          }

          • 2. Re: FLV fullscreen problem
            Petteri_Paananen Community Member

            Thanks, that look promising...

             

            I have a function where I load my external SWF in. I put a listener inside that function:

            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, flvTakeOverDisableF);

             

            Then I cast loaded SWF as a MovieClip inside the function you gave:

             

            function flvTakeOverDisableF(mc:MovieClip){
                    var mc = MovieClip(loader.content);  //casting loaded content as MovieClip mc
                for(var i:uint=0;i<mc.numChildren;i++){
                    if(mc.getChildAt(i) is FLVPlayback){
                        FLVPlayback(mc.getChildAt(i)).fullScreenTakeOver = false;
                        break;
                    } else if(mc.getChildAt(i) is MovieClip){
                        flvTakeOverDisableF(MovieClip(mc.getChildAt(i)));
                    }
                }
               
            }

             

            I still do something wrong, I get warning:

            TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@3d146a01 to flash.display.MovieClip.

            • 3. Re: FLV fullscreen problem
              kglad CommunityMVP

              no, don't edit the code i suggested.  use:

               

               

              function whatever(){

              //your loader code

              .

              .

              loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF );

              }


              function loadCompleteF(e:Event){

              flvTakeOverDisableF(MovieClip(loader.content));

              }

               


               

              function flvTakeOverDisableF(mc:MovieClip){
                  for(var i:uint=0;i<mc.numChildren;i++){
                      if(mc.getChildAt(i) is FLVPlayback){
                          FLVPlayback(mc.getChildAt(i)).fullScreenTakeOver = false;
                          break;
                      } else if(mc.getChildAt(i) is MovieClip){
                          flvTakeOverDisableF(MovieClip(mc.getChildAt(i)));
                      }
                  }
              }

              • 4. Re: FLV fullscreen problem
                Petteri_Paananen Community Member

                Ok, thanks...

                 

                I did that and now I get warning:

                ReferenceError: Error #1065: Variable FLVPlayback is not defined.

                at sourceCS3_fla::MainTimeline/flvTakeOverDisableF()

                at sourceCS3_fla::MainTimeline/magLoaded()

                • 5. Re: FLV fullscreen problem
                  kglad CommunityMVP

                  are you using an flvplayback component?

                  • 6. Re: FLV fullscreen problem
                    Petteri_Paananen Community Member

                    I suppose there has been used FLVPlayback component, but actually I can´t be sure, it looks like one but I only see SWF, not any source.... I must try to ask that.

                    • 7. Re: FLV fullscreen problem
                      Petteri_Paananen Community Member

                      Have not heard a word from authors of that SWF file... but I open SWF into a decompiler and got lots of code... I picked up following function that was inside SWF:

                       

                           public function get fullScreenTakeOver():Boolean
                              {
                                  return flvplayback_internal::uiMgr.fullScreenTakeOver;
                              }

                       

                      Could I call that some way from my loading swf? And disable fullscreen of videoplayer that way?

                      • 8. Re: FLV fullscreen problem
                        kglad CommunityMVP

                        addt an flvplayback component to your loading swf's library.  retest using the code i suggested.  if that fails, delay the execution of the function i supplied for about 500ms after loading is complete and retest.

                        • 9. Re: FLV fullscreen problem
                          Petteri_Paananen Community Member

                          ok,thanks... I tried that. Without delay it didn´t work... what do you think. can I just use setTimeout like this:

                           

                          setTimeout(flvTakeOverDisableF(MovieClip(loader.content)),500);

                          • 10. Re: FLV fullscreen problem
                            kglad CommunityMVP

                            no, use:

                             

                            setTimeout(call_flvTakeOverDisableF,500);


                            function call_flvTakeOverDisableF(){

                            flvTakeOverDisableF(MovieClip(loader.content))

                            }

                            • 11. Re: FLV fullscreen problem
                              Petteri_Paananen Community Member

                              If I keep FLVPlayback component just in Library, it throws me:

                               

                              ReferenceError: Error #1065: Variable FLVPlayback is not defined.
                                  at sourceCS3_fla::MainTimeline/flvTakeOverDisableF()
                                  at sourceCS3_fla::MainTimeline/call_flvTakeOverDisableF()
                                  at Function/http://adobe.com/AS3/2006/builtin::apply()
                                  at SetIntervalTimer/onTimer()
                                  at flash.utils::Timer/_timerDispatch()
                                  at flash.utils::Timer/tick()

                               

                               

                              If I drag it to stage, it doesn´t give any warnings but it behaves strangely. If I open it to browser and push fullscreen button, it opens that empty FLVPlayback Component to fullscreen:

                               

                              flscr.jpg

                              • 12. Re: FLV fullscreen problem
                                Petteri_Paananen Community Member

                                Never mind last one... I just named that extra FLVPlayback and used another fullScreenTakeOver = false; to it... now it works like a charm... million thanks to you (again)....

                                • 13. Re: FLV fullscreen problem
                                  kglad CommunityMVP

                                  you're welcome.

                                  • 14. Re: FLV fullscreen problem
                                    Ghost Of Death Community Member

                                    Whenever I search for a probelm and find a solution, I find that you are the one who posted that solution! Thanks for your great help!

                                    • 15. Re: FLV fullscreen problem
                                      kglad CommunityMVP

                                      you're welcome, too!

                                       

                                      (believe it not, it's not unusual for me to search for the solution to a problem only to find that i'd solved it before.)