Autoplay embedded swf using Ruffle

496 Views Asked by At

I am converting my legacy swf into my blog using Ruffle. I use this code that is perfectly working, but I'd like to make the swf autoplay on loading. Can you help me? Thanks.

<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>
2

There are 2 best solutions below

0
On

Thanks, but I'd rather leave ruffle.js untouched. I am using these lines as suggested by another user:

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

<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/mygame.swf" />    
<embed src="https://www.sinapsi.org/public/mygame.swf" />    
</object>
1
On

I just sorted this out yesterday! There are many configurations that you can add to ruffle, but the documentation is not too easy to understand (or find!). Open your ruffle.js file and add:

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

and providing that you have the call to ruffle on all webpages then the swfs will play automatically.