bower-videogular-youtube icon indicating copy to clipboard operation
bower-videogular-youtube copied to clipboard

Youtube video: change autoplay using radioButton

Open lazaro92 opened this issue 7 years ago • 4 comments

Hi, I see that I can enable Youtube's video autoplay in youtube.js from videogular-youtube pluggin:

playerVars = {
         'controls': 0,
         'showinfo': 0,
         'rel': 0,
         'autoplay': 0, //Switch autoplay to 1 to autoplay videos
         'start': 0
  };

My problem is that I have two radioButtons for enable or disable autoplay. How can I make that, when I select enable autoplay, change the property to autoplay the video?

P.D. Sorry for my English.

lazaro92 avatar Aug 02 '16 07:08 lazaro92

When radioButton change value you need re-set autoplay in playerVars

NamPNQ avatar Aug 02 '16 10:08 NamPNQ

How can I do that? I don't have any idea.

lazaro92 avatar Aug 02 '16 10:08 lazaro92

@lazaro92 Just make your idea in codepen, I'll help you for it work

NamPNQ avatar Aug 02 '16 11:08 NamPNQ

The thing is that I have a database of youtube videos. This database is:

Video : { id: "", url: "", autoplay: "" }

so, when I click radiobutton, it changes the database value of autoplay (true/false). I have to set autoplay when I load the page and obtain the video info from database.

lazaro92 avatar Aug 03 '16 07:08 lazaro92