📜  如何使用 javascript 代码示例在 html5 中添加多个视频

📅  最后修改于: 2022-03-11 15:02:45.128000             🧑  作者: Mango

代码示例1
document.getElementById("myVideo").setAttribute("src",videoSource[0]);
Create a function to load and play the videos.
 
    function videoPlay(videoNum)
    {
document.getElementById("myVideo").setAttribute("src",videoSource[videoNum]);
document.getElementById("myVideo").load();
document.getElementById("myVideo").play();
    }