我有 5 个不同的视频,我希望他们向他们添加一个以上的来源,以便他们可以在更多浏览器中播放,但我不确定如何制作它,以便您可以做到这一点。这是我的 javascript 看起来非常重复的内容
function addVideo1() {
var changeStuff = document.getElementById("myVideo");
changeStuff.src = "video/demoreel.mp4";
}
function addVideo2() {
var changeStuff = document.getElementById("myVideo");
changeStuff.src = "video/video1.mp4";
}
function addVideo3() {
var changeStuff = document.getElementById("myVideo");
changeStuff.src = "video/video2.mp4";
}
function addVideo4() {
var changeStuff = document.getElementById("myVideo");
changeStuff.src = "video/video3.mp4";
}
function addVideo5() {
var changeStuff = document.getElementById("myVideo");
changeStuff.src = "video/video4.mp4";
}