0
votes

I'm trying to find out if I can trigger a new window when the play button is pressed on an html5 audio player.

Here's what my client wants:

  • Press "play" on the html5 audio player on a page
  • Song plays and a new, sized window pops up displaying the lyrics of the song

My brain immediately wants to treat the play button like an on.click behavior that would trigger a window.open... but I can't find if this is possible.

By the way, using a Flash player is not an option in this situation.

Bonus: A way to do this using the WordPress plugin PowerPress..?

Many thanks!

1

1 Answers

0
votes

An HTML5 video player emits a play JavaScript event when the video starts playing. You can add an event listener for it, or add an onplay attribute to the <video> tag.

http://www.w3.org/2010/05/video/mediaevents.html