Skip to main content
Known Participant
August 7, 2013
Answered

Youtube Chromeless Player Controls Help!

  • August 7, 2013
  • 2 replies
  • 630 views

Hi, I'm tearing my hair out trying to add controls such as pause and volume to my Chromeless Youtube Player in Flash with actionscript 3, tried working with the reference that google provide but it still doesn't work. Here's what I tried, can anyone tell me where I'm going wrong?

function pauseVideo() {

  if (player) {

    player.pauseVideo();

  }

}

pauseBtn.addEventListener(MouseEvent.CLICK,pauseVideo);

Thanks



This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Andrei1-bKoviI

You must have compiler error - code shouldn't compile. Event handler expects one argument - Event.

So, correct code would be:

function pauseVideo(e:MouseEvent):void

{

          if (player)

          {

                    player.pauseVideo();

          }

}

pauseBtn.addEventListener(MouseEvent.CLICK, pauseVideo);

2 replies

Andrei1-bKoviICorrect answer
Inspiring
August 8, 2013

You must have compiler error - code shouldn't compile. Event handler expects one argument - Event.

So, correct code would be:

function pauseVideo(e:MouseEvent):void

{

          if (player)

          {

                    player.pauseVideo();

          }

}

pauseBtn.addEventListener(MouseEvent.CLICK, pauseVideo);

jez212Author
Known Participant
August 8, 2013

Thank you! Greatly appreciated