We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cb3821 commit 74d8f44Copy full SHA for 74d8f44
src/headless-hook.js
@@ -2,7 +2,16 @@
2
const origPlay = HTMLMediaElement.prototype.play;
3
HTMLMediaElement.prototype.play = function(...args){
4
if(!this.isConnected){
5
+ let parent = this.parentNode;
6
+ let next = this.nextSibling;
7
try{ (document.body || document.documentElement).appendChild(this); }catch(e){}
8
+ const res = origPlay.apply(this, args);
9
+ try{
10
+ if(parent){
11
+ parent.insertBefore(this, next);
12
+ }
13
+ }catch(e){}
14
+ return res;
15
}
16
return origPlay.apply(this, args);
17
};
0 commit comments