0

Does YouTube API support for the parameter close the browser after particular time?

this need to achieve for promoting the promo video using links to share on a different location. and as soon as the video is ended. close the browser.

1 Answers1

0

You can use Youtube API to monitor is the video is finished then use javascript codes to close the browser.

// when video ends
    function onPlayerStateChange(event) {        
        if(event.data === 0) {            
            alert('done');
          //do something here

        }

http://jsfiddle.net/7Gznb/

References:

Hope this helps.

Mr.Rebot
  • 6,703
  • 2
  • 16
  • 91
  • Thanks, Mr.Rebot, this is helpful but i am not looking for the script. I want to use only URL like https://www.youtube.com/embed/hhtUg3v-KyE?autoplay=1 so here autoplay=1 will play video automatically so i am looking for such parameter to close the browser as soon as video is finished playing – Prashant Pawar Feb 22 '18 at 16:17