ruffle/web/packages/core
Nathan Adams 97110cbecd web: Add renderer type to player debug/panic info 2022-09-04 18:55:13 -07:00
..
src web: Add renderer type to player debug/panic info 2022-09-04 18:55:13 -07:00
test web: Don't include query parameters in downloaded SWF name (#6368) 2022-02-28 22:27:56 +02:00
tools web: Convert .eslintrc files from JSON to YAML 2022-01-12 20:10:00 -08:00
.gitignore chore: Cleanup .gitignore 2021-02-19 16:28:09 -08:00
.mocharc.yaml web: Convert more files from JSON to YAML 2022-01-16 11:07:00 -08:00
README.md docs: Update `streamSwfUrl` to `load` 2020-12-07 15:22:51 -08:00
package.json web: Also enable the "reference-types" feature in the build with WASM extensions 2022-09-02 13:36:20 -07:00
tsconfig.json web: Disallow imports not used as values 2022-08-26 17:27:29 -07:00
typedoc.json web: Cleanup JSON files 2021-02-19 16:28:09 -08: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.