ruffle/web/packages/core
Nathan Adams ccbad52a1e web: Allow overriding of methods via ExternalInterface - fixes #13974 2024-08-06 16:29:10 +02:00
..
src web: Allow overriding of methods via ExternalInterface - fixes #13974 2024-08-06 16:29:10 +02:00
test web: Migrate to 'flat config' style for eslint 2024-07-08 11:34:35 +02:00
texts chore: Update translations from Crowdin 2024-08-05 13:37:33 +02:00
tools web: Use nesting in css 2024-07-19 19:00:35 +02:00
.browserlistrc web: Run cssnano over static css 2024-07-19 19:00:35 +02:00
.gitignore web: Convert core/tools to typescript 2024-06-12 23:33:01 +02:00
.mocharc.yaml web: Replace ts-node with tsx (mostly) 2024-06-12 23:33:01 +02:00
README.md docs: Update `streamSwfUrl` to `load` 2020-12-07 15:22:51 -08:00
package.json build(deps-dev): bump postcss-nesting from 12.1.5 to 13.0.0 in /web 2024-08-05 18:15:51 +02:00
tsconfig.json web: Use eslint2021 as target, all our min browser versions support this 2024-07-17 13:00:01 +02:00
typedoc.json web/docs: Display enums in source order 2023-04-24 08:49:06 +03:00

README.md

ruffle-core

ruffle-core is the core javascript bindings to the Wasm ruffle-web binary, and contains the actual public API.

Using ruffle-core

For more examples and in-depth documentation on how to use Ruffle on your website, please check out our wiki.

Host Ruffle

The core package is configured for websites that build and bundle their files themselves. Simply add ruffle to an npm package, and use something like Webpack to actually bundle and serve the files.

If you wish to use Ruffle on a website that doesn't use npm, we have a pre-bundled version which we call 'selfhosted'. Please refer to its documentation.

Please note that the .wasm file must be served properly, and some web servers may not do that correctly out of the box. Please see our wiki for instructions on how to configure this, if you encounter a Incorrect response MIME type error.

"Plug and Play"

If you have an existing website with flash content, you can simply include Ruffle as a script and our polyfill magic will replace everything for you. No fuss, no mess.

<script src="path/to/ruffle/ruffle.js"></script>

Javascript API

If you want to control the Ruffle player, you may use our Javascript API.

<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="path/to/ruffle/ruffle.js"></script>

Building, testing or contributing

Please see the ruffle-web README.