function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Will Sun 14Will Sun 14 

How to let youtube autoplay in VF page after landed to the page

Hi All,

I need to a help in VF page, I have created enbed youtube link in VF page which allow users to click and view the youtube video. But how could I setup a autoplay function after you have landed to the VF page?

Thank you 
Best Answer chosen by Will Sun 14
Raj VakatiRaj Vakati
try this code

set ?autoplay=1&cc_load_policy=1.
 
<iframe width="420" height="315" src="https://www.youtube.com/embed/
oHg5SJYRHA0?autoplay=1&cc_load_policy=1" frameborder="0"
allowfullscreen></iframe>

 

All Answers

Raj VakatiRaj Vakati
try this code

set ?autoplay=1&cc_load_policy=1.
 
<iframe width="420" height="315" src="https://www.youtube.com/embed/
oHg5SJYRHA0?autoplay=1&cc_load_policy=1" frameborder="0"
allowfullscreen></iframe>

 
This was selected as the best answer
Will Sun 14Will Sun 14
Hi Raj,
Thank you, I have added the code and it works for 1 min and then not autoplay...
 
Raj VakatiRaj Vakati
refresh the page and try ..  
Will Sun 14Will Sun 14
I have refreshed the page several times, still not playing