5 Replies Latest reply on Dec 16, 2010 11:53 AM by AdeptDigital

    Volume and seek bar handles missing from video player...

    MSchoaf384756

      I am creating a custom flash video player for my friend's wife's surprise 40th birthday party. I was progressing through and everything was working fine, but now the seekbar and volume bar handles are completely gone. I was working on doing some buttons to load each video segment when I realized the missing handles. My actionscript is below:

       

       

      import fl.video.*;

      var flvPlayer:FLVPlayback = new FLVPlayback();
      addChild(flvPlayer);

      flvPlayer.playButton = playbtn; 
      flvPlayer.pauseButton = pausebtn;
      flvPlayer.seekBar = seekbar;

      flvPlayer.x=78;
      flvPlayer.y=39;
      flvPlayer.width=640;
      flvPlayer.height=360;
      flvPlayer.source = "flv/video1.f4v";


      vid1.addEventListener(MouseEvent.CLICK, fl_ClickToSetSource1);

      function fl_ClickToSetSource1(event:MouseEvent):void
      {
      flvPlayer.source = "flv/video1.f4v";
      }

      vid2.addEventListener(MouseEvent.CLICK, fl_ClickToSetSource2);

      function fl_ClickToSetSource2(event:MouseEvent):void
      {
      flvPlayer.source = "flv/video2.f4v";
      }

       

      The play/pause buttons work perfectly, so I'm at a loss what is going on...any ideas would be most appreciated.

       

      P.S. Take it easy on my code....I'm not the most proficient.

        • 1. Re: Volume and seek bar handles missing from video player...
          AdeptDigital Level 2

          I don't know what version of Flash you are on or if this messes with your code Kung Fu but why not just use a pre-built skin?  It seems the exact controls you are looking for can be accomplished via a skin that is setup with the FLV file in the Parameters Control Window.  If you want to customize the player with a theme not found in the presets just take an existing skin, import it into Flash as if it were a source file and rework the artwork to your liking.  Then re-publish it with a new name and copy the SWF into the FLVPlayback Skins folder in your app file.  This will give you a reliable result without having to re-invent the wheel.  It has worked several times in the past for me when I needed to get something to work reliably and quickly.  Just remember that if you are using AS3 for your project, you should use the AS3 version of the skin with the functions you want.

           

          At the very least you should be able to import the SWF file into Flash to look at the code the almighty programmers used in order to get their versions to work.  Usually I find the coding from Adobe to be really bullet proof.

           

          Hope this helps,

          Brett

          • 2. Re: Resetting Playhead Position After Loading Video
            MSchoaf384756 Level 1

            Ok BE...I took you advice and used a prebuilt skin, but tweeked it to get it looking how I wanted. However, now when I switch between the different videos, the playhead stays at the spot that it previously was. For example, if the playhead is currently 50% through video #1 and I click video #2, the playhead is still sitting at 50%. How would I reset the playhead to the beginning of the new video?

             

            import fl.video.*;

            var flvPlayer:FLVPlayback = new FLVPlayback();
            addChild(flvPlayer);

             

            flvPlayer.skin = "MySkin.swf";
            flvPlayer.skinAutoHide = true;
            flvPlayer.skinFadeTime = 300;
            flvPlayer.x=78;
            flvPlayer.y=89;
            flvPlayer.width=640;
            flvPlayer.height=360;
            flvPlayer.source = "flv/Video1.f4v";


            vid1.addEventListener(MouseEvent.CLICK, fl_ClickToSetSource1);

            function fl_ClickToSetSource1(event:MouseEvent):void
            {
            flvPlayer.source = "flv/Video1.f4v";
            }

            vid2.addEventListener(MouseEvent.CLICK, fl_ClickToSetSource2);

            function fl_ClickToSetSource2(event:MouseEvent):void
            {
            flvPlayer.source = "flv/Video2.f4v";
            }

             

             

            I know I need to do something in the setSource function, but don't know how.

             

            Thanks.

            Mike

            • 3. Re: Resetting Playhead Position After Loading Video
              AdeptDigital Level 2

              Ok, first off I need to ask a few questions.

               

              It looks like you are loading more than on FLV into the same skin for playback function.  That is cool, I have never tried that, very innovative.  Are you going to upload the FLVs as separate files onto the server or include them into the SWF?  Mostly I am just curious but I also want a more clear picture of what you are doing.

               

              In the perameters control window do you have the Auto-Rewind function set to true or false for these clips?  The behavior you are describing almost sounds like both the Auto-Play and the Auto-Rewind functions are set to false.  I would try setting them to True.  If you do not want the clip to play automatically upon load in that's cool but I think the Auto-Rewind function in this control panel may just solve it for you.

               

              Since I have never done this I would not know what to recommend for the setSource function but what I do know of it does not control the point where the movie starts.  In this application it may just do that but I would be more inclined to believe that it sets up the source and that the player controls assigned to the instance on the stage would be more relavent to this problem.  Give the perameters panel fix a shot and let me know how it turns out.

               

              Good Luck,

              Brett

              • 4. Re: Resetting Playhead Position After Loading Video
                MSchoaf384756 Level 1

                Thanks Brett.

                 

                Since I'm loading the videos through ActionScript there is no way to access the parameters panel. The videos are uploaded to the server as separate f4v files. I think I might have figured it out:

                 

                vid1.addEventListener(MouseEvent.CLICK, fl_ClickToSetSource1);

                function fl_ClickToSetSource1(event:MouseEvent):void
                {
                flvPlayer.source = "flv/Video1.f4v";

                flvPlayer.seek(0);
                }

                vid2.addEventListener(MouseEvent.CLICK, fl_ClickToSetSource2);

                function fl_ClickToSetSource2(event:MouseEvent):void
                {
                flvPlayer.source = "flv/Video2.f4v";

                flvPlayer.seek(0);
                }

                 

                 

                This seems to reset the playhead.

                 

                Mike

                • 5. Re: Resetting Playhead Position After Loading Video
                  AdeptDigital Level 2

                  flvPlayer.seek(0);

                   

                  I like, very nice.  Have a Happy Holidays!

                  1 person found this helpful