Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasrhee1208wastaken authored Jan 17, 2024
1 parent 12d8b72 commit a862726
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@

swfobject.embedSWF = function(url, cont, width, height){
var ruffle = window.RufflePlayer.newest(),
player = Object.assign(document.getElementById(cont).appendChild(ruffle.createPlayer()), {
width: width,
height: height,
style: 'width: ' + width + 'px; height: ' + height + 'px',
});
existingPlayer = document.getElementById(cont).querySelector('.ruffle-player');

if (existingPlayer) {
existingPlayer.parentNode.removeChild(existingPlayer);
}

var player = Object.assign(document.getElementById(cont).appendChild(ruffle.createPlayer()), {
width: width,
height: height,
style: 'width: ' + width + 'px; height: ' + height + 'px',
});

player.load({ url: url });
};
Expand Down

0 comments on commit a862726

Please sign in to comment.