12 Replies Latest reply: Jan 25, 2013 1:06 PM by jacquesge RSS

    Caption button won't appear

    JacquesGenevieve Community Member

      Hi!

       

      I added a FLVPlayback and FLVPlaybackCaptioning on my scene. Each instance are named respectively "display" and "caption".

       

      The skin I use is SkinUnderPlaySeekCaption.swf

       

      The showCaptions parameter into the FLVPlaybackCaptioning is set to "true".

       

      When I publish the file, the play button and the seekbar are there, but not the caption button.

       

      Why is it not showing? How can I force it to show?

       

      Thank you for your help.

       

      Here's the code, in case you might need it :

       

      import fl.video.*;

      import fl.controls.ProgressBarMode;

       

      var flvControl:FLVPlayback = display;

      var flvCaption:FLVPlaybackCaptioning = caption;

      var flvSource:String = "videos/P01_Intro.flv";

       

      caption.source = "intro.xml";

       

      function progressHandler(event:VideoProgressEvent):void{

         var bl:Number = Math.round(event.bytesLoaded/1000);

         var bt:Number = Math.round(event.bytesTotal/1000);

       

         pb.setProgress(bl,bt);

      }

       

      function readyHandler(event:VideoEvent):void{

         removeChild(pb);

         display.play();

      }

       

      pb.mode = ProgressBarMode.MANUAL;

      pb.indeterminate = false;

       

      flvControl.addEventListener(VideoProgressEvent.PROGRESS, progressHandler);

      flvControl.addEventListener(VideoEvent.READY, readyHandler);

      flvControl.source = flvSource;

        • 1. Re: Caption button won't appear
          kglad CommunityMVP

          the source for flvControl should be a timed text xml file, not an flv.

           

          check the help files for how to create that file.

          • 2. Re: Caption button won't appear
            JacquesGenevieve Community Member

            It is a xml?

             

            caption.source = "intro.xml";

             

            The .flv is the video...?

             

            Everything works fine. The subtitles appears on the video. It's just the button that won't appear. So basically, I have no choice, for now, to keep the subtitles always on or off.

            • 3. Re: Caption button won't appear
              kglad CommunityMVP

              correct, it is an xml.  actually, an xml with a specific (timed text) format:

               

              from the flash help files:

               

              var xml:XML = <?xml version="1.0" encoding="UTF-8"?>

                   <tt xml:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1"  xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling">

                       <head>

                           <styling>

                               <style id="1" tts:textAlign="right"/>

                               <style id="2" tts:color="transparent"/>

                               <style id="3" style="2" tts:backgroundColor="white"/>

                               <style id="4" style="2 3" tts:fontSize="20"/>

                           </styling>

                       </head>

                       <body>

                            <div xml:lang="en">

                               <p begin="00:00:00.50" dur="500ms">Four score and twenty years ago</p>

                               <p begin="00:00:02.50"><span tts:fontFamily="monospaceSansSerif,proportionalSerif,TheOther"tts:fontSize="+2">our forefathers</span> brought forth<br /> on this continent</p>

                               <p begin="00:00:04.40" dur="10s" style="1">a <span tts:fontSize="12 px">new</span> <span tts:fontSize="300%">nation</span></p>

                               <p begin="00:00:06.50" dur="3">conceived in <span tts:fontWeight="bold" tts:color="#ccc333">liberty</span> <span tts:color="#ccc333">and dedicated to</span> the proposition</p>

                               <p begin="00:00:11.50" tts:textAlign="right">that <span tts:fontStyle="italic">all</span> men are created equal.</p>

                               <p begin="15s" style="4">The end.</p>

                           </div>   

                       </body>

                   </tt>

               

              and the caption button needs to be created and coded by you or, use a skin with a caption button like the skin you said you used, SkinUnderPlaySeekCaption.swf

              • 4. Re: Caption button won't appear
                JacquesGenevieve Community Member

                Yup. That's what I have too.

                 

                The subtitles are working quite fine. It's the button on the skin that won't appear.

                 

                I tried adding the code manually, instead of using the component inspector. For a while I kept the old FLVPlayback on the stage as I was programming the new one. I published and : the button was there on my new instance! (But wasn't functionnal.) Then I flushed the first one from the stage, keeping the one that worked, re-published : it disappeared again!

                • 5. Re: Caption button won't appear
                  kglad CommunityMVP

                  upload your files to a server and post a link. or, attach a screenshot showing your caption.swf skin with video playing.

                  • 6. Re: Caption button won't appear
                    JacquesGenevieve Community Member

                    I put it back the way it was before (the code mainly on the component inspector and the rest in an action layer).

                    screenshot.jpg

                    • 7. Re: Caption button won't appear
                      kglad CommunityMVP

                      i don't see that but i don't have a french flash pro version so, who knows.

                       

                      anyway, drag a caption button from the component panel, place it where that skin's button should be visible and assign an instance name (eg, cap_btn).

                       

                      then use:

                       

                      caption.captionButton=cap_btn;

                      • 8. Re: Caption button won't appear
                        jacquesge Community Member

                        Yesss! That solved the problem! Thank you!

                         

                        I still don't know why the button wouldn't show in the first place (since the play button and the seekbar are visible without having to add them individually on the stage). But the good news is that : now it works!

                         

                        I did have to add a little function to toggle the visibility : obviously. I'll write it down, in case it might be useful to anyone in the future.

                         

                        ---

                         

                        cap_btn.addEventListener(MouseEvent.CLICK,onCaptionChange);

                         

                        function onCaptionChange(e:*):void {

                          if (caption.showCaptions){

                              caption.showCaptions = false;

                             } else {

                              caption.showCaptions = true;

                             }

                        }

                        • 9. Re: Caption button won't appear
                          kglad CommunityMVP

                          that's interesting because you should not need that, either.

                           

                          but, at least, you got it working.

                          • 10. Re: Caption button won't appear
                            jacquesge Community Member

                            Really? Indeed it's strange, because I tried it before adding this function and the button did appear, but I couldn't toggle the visibility of the text. It worked only when I added the function...

                             

                            It seems I'm not the first one who had this problem : http://forums.adobe.com/thread/796423

                            • 11. Re: Caption button won't appear
                              kglad CommunityMVP

                              what cs version are you using and what swf version are you publishing for?

                              • 12. Re: Caption button won't appear
                                jacquesge Community Member

                                CS4 and 10.