Automatically go to next page when embedded youtube video has ended

More
5 years 2 months ago #77000 by davidspivak
davidspivak created the topic: Automatically go to next page when embedded youtube video has ended
Hi,

This might be a bit tricky but I'm pretty sure it's doable.
I have a page with a 'text display' question. In it there is an embedded youtube movie that automatically starts playing when the page loads.

What I would like to do is this:
1. Hide the 'Next' button in this specific page.
2. Automatically make the survey go to the next page when the player has finished playing.

Now I did a bit of googling and I know there's a function called "onStateChange" (src: https://developers.google.com/youtube/js_api_reference ) which is fired whenever the youtube player's state changes (states could be "unstarted", "ended", "paused", etc.).

So basically the puzzle parts are there, but I just can't put them together since I don't know how to code these things or where to put these pieces of codes.

I'd appreciate any help,
David

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now