Skip to content

Commit

Permalink
fix bug which caused some iframes to load multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
orestbida committed Sep 8, 2021
1 parent 07b573a commit 2cf4aa6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/iframemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@
// Create iframe only if doesn't alredy have one
if(video.hasIframe) return;

video.hasIframe = true;

if(typeof service['onAccept'] === 'function'){



// Let the onAccept method create the iframe
service['onAccept'](video.div, function(iframe){
Expand Down Expand Up @@ -274,7 +274,6 @@
service['iframe'] && typeof service['iframe']['onload'] === 'function' && service['iframe']['onload'](video._id, this);
}

video.hasIframe = true;
video.div.appendChild(video.iframe);
},

Expand Down Expand Up @@ -423,11 +422,6 @@


observe : function(target, callback){

console.log("observing", target);



var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if(mutation.type === 'childList'){
Expand Down

0 comments on commit 2cf4aa6

Please sign in to comment.