I have a video dom Why does dom execute a onstalled after switching the browser tab before or during resource loading
Now, I just added a retry plan,Is there a better solution?
My goal is to switch the browser tab dom to load the resource successfully
thanks
let dom = document.createElement('video');
dom.preload = 'metadata';
dom.muted = true;
dom.onloadedmetadata = function() {
}
dom.onseeked = function() {
}
let t;
dom.onstalled = () => {
clearTimeout(t);
t = setTimeout(function() {
dom.load();
},1000);
}
dom.src = url;