今天设置背景音乐,无法在IOS手机播放
找了好多代码,终于找到可以解决方法的,而且还比较通俗易懂
function myPlay(){
var audio = document.getElementById('audio'),
play = function(){
audio.play();
document.removeEventListener("touchstart",play,
今天在运行video的时候,提示
video:10 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.
这个静音播放是给 video 标签上 加上一个 muted属性 静音播放 播放的时候 用户想听声音了 让他自己再重新打开
//
今天运行video视频的时候,提示这个
Access to XMLHttpRequest at rom origin 'http://www.chenjianlin.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.