Autostart+loop videos YouTube videos

前端 未结 6 1274
旧时难觅i
旧时难觅i 2021-02-04 06:27

YouTube recently discarded the old \"embed\" code and replaced it with iframe code.

In the new iframe code I found the way to loop+autostart videos on my website, thanks

相关标签:
6条回答
  • 2021-02-04 06:44

    Copy the YouTube Embedded code then make these amendments.

    • Change embed to v
    • insert &autoplay=1
    • insert &loop =1
    • insert &playlist = "video-id"

    This gives:

    <iframe width="420" height="315" src="//www.youtube.com/v/agAX34aHvCM&autoplay=1&loop=1&playlist=agAX34aHvCM" frameborder="0" allowfullscreen></iframe>
    

    There are so many people having trouble with this.....

    Note: This parameter has limited support in the AS3 player and in IFrame embeds, which could load either the AS3 or HTML5 player. Currently, the loop parameter only works in the AS3 player when used in conjunction with the playlist parameter. To loop a single video, set the loop parameter value to 1 and set the playlist parameter value to the same video ID already specified in the Player API URL.

    0 讨论(0)
  • 2021-02-04 06:53

    This is the correct way to loop the videos of a playlist (as Google explains here)

    <iframe width="100%" height="100%" src="http://www.youtube.com/embed?
        listType=playlist&
        list=PLAYLIST_ID&
        version=3&
        loop=1&
        autoplay=1&
        rel=0&
        showinfo=0&
        controls=0&
        autohide=1
    " frameborder="0" allowfullscreen></iframe>
    
    0 讨论(0)
  • 2021-02-04 06:54

    It appears that the loop parameter requires the playlist param as well, - I'm adding the note from YouTube's documentation.

    Note: This parameter has limited support in the AS3 player and in IFrame embeds, which could load either the AS3 or HTML5 player. Currently, the loop parameter only works in the AS3 player when used in conjunction with the playlist parameter. To loop a single video, set the loop parameter value to 1 and set the playlist parameter value to the same video ID already specified in the Player API URL:

    0 讨论(0)
  • 2021-02-04 07:00

    use playlist= you video embed autoplay=1 and loop=1 try this and see

    <iframe style="height:600px;width:100%" src="https://www.youtube.com/embed/ithw-xIyd_8?playlist=ithw-xIyd_8&loop=1&autoplay=1" frameborder="0" allowfullscreen" ></iframe>
    

    it work powerful

    0 讨论(0)
  • 2021-02-04 07:03

    SEE ALL OPTIONS descriptions CLICK here

    autohide
    autoplay
    cc_load_policy
    color
    controls
    disablekb
    enablejsapi
    end
    fs
    hl
    iv_load_policy
    list
    listType
    loop
    modestbranding
    origin
    playerapiid
    playlist
    playsinline
    rel
    showinfo
    start
    theme

    0 讨论(0)
  • 2021-02-04 07:04

    I came here with a similar question. That question has been solved, heres how i did it. Where you link the source, just get the original embed code, then replace the part that says embed with v. ex:

    www.youtube.com/v/lG5aSZBAuPs
    

    (embed was originally here, now its a v)

    Now add these attributes (or whatever the name for them would be) to the end of that embed link:

    1. &autoplay=1
    2. &loop=1
    3. &playlist=lG5aSZBAuPs <-- this is the video id shown at the end of the embed source link.

    so at the end the link should look like so:

    <iframe width="853" height="480" src="//www.youtube.com/v/lG5aSZBAuPs&autoplay=1&loop=1&playlist=lG5aSZBAuPs" frameborder="0" allowfullscreen></iframe>
    
    0 讨论(0)
提交回复
热议问题