Forum Discussion
Embedded Youtube Video in Dashboard - auto play
- 5 years ago
Hi Eyelyn9,
Thanks for that, that worked, but I also went a step further and adapted your code and tried with youtube.
I got it working, so I can embed youtube videos the same way, the turning point was a difference in url structure:
<iframe width="420" height="345" src="https://www.youtube.com/watch?v=whatever?autoplay=1"></iframe>
Does not work, but the below:<iframe width="420" height="345" src="https://www.youtube.com/embed/whatever?autoplay=1"></iframe>
does work, the difference was watch vs embed in the url structure.
Hope this may help someone.
Since April 2018, Google made some changes to the Autoplay Policy. You not only need to add the autoplay=1 as a query param, but also add allow='autoplay' as an iframe's attribute
So while embed youtube video, you will have to do something like this:
<iframe src="https://www.youtube.com/embed/VIDEO_ID?autoplay=1" allow='autoplay'></iframe>