: 콘텐츠가 이미 (캐시에서와 같은)을로드 할 때
또한
video.addEventListener("playing", function() {
console.log("[Playing] loading of video");
if (video.readyState == 4) {
console.log("[Finished] loading of video");
}
});
video.addEventListener("suspend", function(e) {
console.log("[Suspended] loading of video");
if (video.readyState == 4) {
console.log("[Finished] loading of video");
}
});
소스 사례 위해 연주를 듣고 싶은 것 을 때에로드 할 때까지 매 30 초를 확인하여 비디오 변화의 readyState
.
checkforVideo();
function checkforVideo() {
var b = setInterval(()=>{
if(VideoElement.readyState >= 3){
\\do whatever you want done here
\\you can now clearInterval (stop checking every half second)
clearInterval(b);
}
},500);
}
당신이하지 않은 경우 USI ES6 만 () =>
을 (를) function()
으로 대체하십시오. 해당 브라우저를 지원하는 브라우저는 무엇입니까? –
@JaredFarrish이 [Wiki] (http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28HTML5_Media%29)에 따르면 지원이 완료되었습니다 (WebKit 열은 비어 있지만 구현이 지연되면 놀랄 것입니다. 모질라/오페라). –
> 1을 찾으면 막 추구 할 수 있습니다. – Costa