video 自動播放

Rain_發表於2019-01-26

video

1

 <video id="bgmusic" autoplay preload muted controls="controls">                    <source type="video/mp4" src="../../pic/004eFBIOlx07qZoDasFa010412019lEY0E010.mp4">                </video>複製程式碼

2

<video id="bgmusic" autoplay preload muted>              <source                type="video/mp4"                src="../../pic/004eFBIOlx07qZoDasFa010412019lEY0E010.mp4"              />            </video>
 (function() {        function log(info) {          console.log(info);        }        function forceSafariPlayAudio() {          audioEl.load();          audioEl.play();        }
        var audioEl = document.getElementById("bgmusic");
        window.addEventListener("ready", forceSafariPlayAudio, false);      })();
複製程式碼


相關文章