show/hide mpg

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • pjvbh
    Indigo Rose Customer
    • Sep 2002
    • 12

    show/hide mpg

    Hi all, first post ... is it possible to use a page action Page.HideObject to hide a media player object for an external MPG1, and then use Page.ShowObject from a text action to show (and then play) the MPG?

    When I try this I get "Could not play the specified media player object -- object not found on this page."

    I am able to show/hide in this way with a text object, but not so far with a media player object.

    Thanks,
  • Lorne
    Indigo Rose Staff Member
    • Feb 2001
    • 2729

    #2
    Re: show/hide mpg

    Can you elaborate a bit more? [img]/ubbthreads/images/icons/smile.gif[/img]

    What event are the actions being triggered by? When exactly does this happen (when you click on your text object, when the page loads, or...?)
    --[[ Indigo Rose Software Developer ]]

    Comment

    • pjvbh
      Indigo Rose Customer
      • Sep 2002
      • 12

      #3
      Re: show/hide mpg

      Thanks for your response, Lorne.

      This is a test project with one page. The page has an On Initialize action; Page.HideObject("playa") that hides the media player.

      The Media Player object on the page references an external file "intro.mpg" in the Distribution directory.

      Some scrollable text is visible on the page in an object called TextBox1.

      When the page loads, the text is visible, the media player is not - this is correct.

      There are two other text objects on the page, one saying "Play", the other saying "Stop."

      The "Play" text has three actions triggered by On Mouse Click:
      Page.HideObject("TextBox1")
      Page.ShowObject("playa")
      MediaPlayerObject[playa].Play

      ---

      When I preview the page, the page loads correctly, showing the text only. When I click the "Play" text, I get a message ...

      "Could not play specified media player object. The object was not found on this page. 'playa' "

      (The "stop" text will stop and hide the media player and show the text box.)

      Regards,

      Comment

      • Derek
        Indigo Rose Customer
        • May 2001
        • 1254

        #4
        Re: show/hide mpg

        Hi - This sounds like a hiccup I came across a few days ago. Try adding a 1 second Application.Sleep between Object.Show and Play

        Page.ShowObject("playa")
        Application.Sleep (1)
        MediaPlayerObject[playa].Play


        to see what happens. If it plays ok ... delete Application.Sleep and see if it runs OK from then on. Mine did (odd but true)!
        -
        = Derek
        ["All glory comes from daring to begin" - fortune cookie]

        Comment

        • pjvbh
          Indigo Rose Customer
          • Sep 2002
          • 12

          #5
          Re: show/hide mpg

          Derek; odd, but not quite true for me ... adding Application.Sleep between show and play DID fix the problem!

          But then removing it again re-introduced the problem again in my case.

          I'm going to try setting up a new project from scratch and re-testing -- thanks for your suggestion,

          Comment

          • pjvbh
            Indigo Rose Customer
            • Sep 2002
            • 12

            #6
            Re: show/hide mpg

            Derek:

            I have found that adding a brief application.sleep does enable the MPG to play after being "shown" on a burned CD, but does not in preview mode on my system.

            (My system is probably untypical - Mac OS X / Virtual PC for Windows XP.)

            However, I still can't get a CD without any added sleep to play the MPG correctly on a W2K machine. The first frame of the movie shows as the error message displays. After clearing the error, the MPG will play if I click the "Play" text again.

            Do you think I shoud go back to using AVIs, or "hide" the media player behind a piece of background art? Do you have any other work-arounds to suggest?

            Thanks,

            Comment

            • Lorne
              Indigo Rose Staff Member
              • Feb 2001
              • 2729

              #7
              Re: show/hide mpg

              I could have sworn that Mark coded this oddity out of existence...but the problem is essentially that the WMP control isn't ready to play yet by that point.

              One thing you could try is to put the actual play action on the Media Player Object's "On Stream Open" event.

              If you need to be able to only play it some of the time, then use a variable like %play_video% as a switch...setting the variable to "TRUE" when you want the video to play, and "FALSE" when you don't...and using an IF action in the "On Stream Open" event to only do the "Media Player Object - Play" if %play_video% is true.
              --[[ Indigo Rose Software Developer ]]

              Comment

              • pjvbh
                Indigo Rose Customer
                • Sep 2002
                • 12

                #8
                Re: show/hide mpg

                I just read the notes on Z-order control of MPOs, so my whole page design idea will need to be split into two pages, (one for the text "in front of" the video, and the next for the video), with buttons that jump between the two. This will then also take care of the problem with playing a previously hidden MPO, I hope!

                Thanks for your help on this issue,

                Comment

                • Lorne
                  Indigo Rose Staff Member
                  • Feb 2001
                  • 2729

                  #9
                  Re: show/hide mpg

                  Guys, there's an even better solution to this: just set the Media Player Object to begin playing the video automatically. Then it should start playing automatically when it's shown.

                  Thank Darryl for reminding me about this this morning. [img]/ubbthreads/images/icons/smile.gif[/img]
                  --[[ Indigo Rose Software Developer ]]

                  Comment

                  Working...
                  X