最近做项目遇到video加载资源在iOS(iPadOS) safari不触发canplaythrough事件的状况
src设置后调用load()可以解决ios版本较新的机器(ios14及以上),
var video = document.createElement('VIDEO');
video.addEventListener('canplaythrough', loadedVideo, false);
video.src = url;
video.load();
var video = document.createElement('VIDEO');
video.addEventListener('canplaythrough', loadedVideo, false);
video.src = url;
video.load();
本文标题:video-canplaythrough事件不触发
本文链接:https://www.haomeiwen.com/subject/tbmpqltx.html
网友评论