Get Multiple Embedded Youtube Videos to Play Automatically in Sequence

前端 未结 6 2066
遇见更好的自我
遇见更好的自我 2021-02-02 03:19

Is there any simple way to have multiple embedded YouTube videos on a page and have them start playing as soon as the page is opened and when the first one finished have the sec

6条回答
  •  南旧
    南旧 (楼主)
    2021-02-02 04:16

    Here is an example using the YouTube Iframe Player API.

    There are two separate embeds (player1 and player2). The video autoplays when player1 has loaded, and it starts player2 when it completes.

    Here is the jfiddle if you want to play around with it.

    And the code:

提交回复
热议问题