Is there a way to add ruffle to my website?

650 Views Asked by At

I dont have acsesses to the code on ruffle.js and when i try ti use other metheits it says extension blocked but ruffle has worked on this computer and anyone help? "My" code rn is:

<!DOCTYPE HTML>
<html>
    <head>
        <meta charset='utf8'>
    </head>
    <body>
        <div id='ruffle'></div>
<script>
    window.RufflePlayer = window.RufflePlayer || {};

    window.addEventListener("DOMContentLoaded", () => {
        let ruffle = window.RufflePlayer.newest();
        let player = ruffle.createPlayer();
        let container = document.getElementById("container");
        container.appendChild(player);
        player.load("movie.swf");
    });
</script>
<script src="https://flash-games.penguinbotcoder.repl.co/ruffle/ruffle.js"></script>
<object width="600" height="400">
    <param name="movie" value="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
    <embed src="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
    </embed>
</object>
<script src="path/to/ruffle/ruffle.js"></script>
    </body>
    <div class=ruffle>
    </div>
    <p>This is a test page for flash content</p>
</html>

as i sayed up there its just not working :(

1

There are 1 best solutions below

1
On

I don't understand well what is exactly the problem but this is what I noticed from you code: You are trying to get an element by id container but you don't have that element in your HTML, I think you try to use the element with id ruffle instead.

window.addEventListener("DOMContentLoaded", () => {
    let ruffle = window.RufflePlayer.newest();

    let player = ruffle.createPlayer();
    let container = document.getElementById("ruffle");
    container.appendChild(player);
player.load("movie.swf");
});

Update:
If still not working then try this example code and see if it loads the Flash content...

<!DOCTYPE HTML>
<html>
    <head> <meta charset='utf8'> </head>
    
    <body>
    
        <script src="https://flash-games.penguinbotcoder.repl.co/ruffle/ruffle.js"></script>
    
        <div id='ruffle'></div>
        
        <p>This is a test page for Adobe Flash content</p>
        
    </body>
    
    <script>
    
        window.RufflePlayer = window.RufflePlayer || {};
        window.addEventListener("DOMContentLoaded", start_Ruffle, false );
        
        function start_Ruffle()
        {
            let ruffle = window.RufflePlayer.newest();
            let player = ruffle.createPlayer();
            let container = document.getElementById("ruffle");
            container.appendChild(player);
            player.load("https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf");
            
        }
        
    </script>

</html>