Is there a way to embed .swf files and ruffle flash player in google sites 2021?

2.7k Views Asked by At

I'm currently working on a miniclip-newgrounds-like website with old flash games. I really don't know how to embed flash files now, the new UI kind of confuses me. Of course, flash won't work anymore so I have to embed ruffle flash emulator.

How can I do these stuff?

Thanks.

3

There are 3 best solutions below

0
On

This is actually possible. In the new google sites, You have embed components which allow you to embed ruffle. The snippet below should work. You can replace script src to your ruffle script, But I already put one there for you. Change the object's height and width to whatever you like. Change the movie value and embed src to your flash game swf link. E.G. https://sites.google.com/view/penguinpoint/community it will take some time to load, though.

<script src="https://unpkg.com/@ruffle-rs/ruffle"></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>

0
On

Use the embed option and link to your swf file. Here is some embed code to put into it. I also use this on WIX. It now plays AS2 great. The code auto plays.

<script>
window.RufflePlayer = window.RufflePlayer || {};
window.RufflePlayer.config = {
    "autoplay": "on","splashScreen": false,"unmuteOverlay": "hidden"
};

    window.addEventListener("load", (event) => {
        const ruffle = window.RufflePlayer.newest();
        const player = ruffle.createPlayer();
        const container = document.getElementById("container");
        container.appendChild(player);
        player.load("https://example.com/Your-Movie.swf");
        player.style.width = "700px";
        player.style.height = "400px";
    });
</script>
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
<div id="container"></div>
0
On

Thank you very very much for this code! I am happily using it in my site so I could run again hundreds of old but nice swf file! I wonder if it's possible to add a "autoplay" or "autostart" feature to this piece of code.

<script src="https://www.sinapsi.org/public/ruffle/ruffle.js"></script>
<object width="750" height="550">
<param name="movie" value="https://www.sinapsi.org/public/espressione01.swf">
<embed src="https://www.sinapsi.org/public/espressione01.swf">
</embed>
</object>