How to make an embedded Youtube video automatically start playing?

后端 未结 4 1975
梦如初夏
梦如初夏 2020-12-13 09:06

In my project, there is a video gallery module. In this module, there are two options: direct FLV uploading, and adding a video embed code from YouTube.

I am writin

相关标签:
4条回答
  • 2020-12-13 09:27

    Add &autoplay=1 to your syntax, like this

    <iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/zGPuazETKkI&amp;autoplay=1" frameborder="0" allowfullscreen></iframe>
    
    0 讨论(0)
  • 2020-12-13 09:28

    This works perfectly for me try this just put ?rel=0&autoplay=1 in the end of link

    <iframe width="631" height="466" src="https://www.youtube.com/embed/UUdMixCYeTA?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>
    
    0 讨论(0)
  • 2020-12-13 09:33
    <iframe title='YouTube video player' class='youtube-player' type='text/html'
            width='030' height='030'
            src='http://www.youtube.com/embed/ZFo8b9DbcMM?rel=0&border=&autoplay=1'
            type='application/x-shockwave-flash'
            allowscriptaccess='always' allowfullscreen='true'
            frameborder='0'></iframe>
    

    just insert your code after embed/

    0 讨论(0)
  • 2020-12-13 09:37

    You have to use

    <iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/zGPuazETKkI?autoplay=1" frameborder="0" allowfullscreen></iframe>
    

    ?autoplay=1

    and not

    &autoplay=1

    its the first URL param so its added with a ?

    0 讨论(0)
提交回复
热议问题