A Flash Player emulator written in Rust
Go to file
Kornelius Rohrschneider 893052c2a6 core: Add MovieClip error state
A load_error_swf function has been added to the Loader. It makes the
MovieClip enter the error state in which some attributes have certain
error values to signal that no valid file could be loaded. This happens
if no file could be loaded or if the loaded content is no valid
supported content.
The function creates an error state movie stub using the new
SwfMovie::error_movie function (which uses a new default_error_header
function) and configures remaining variables with the
movie_not_available method.
One TODO in order for the error state to be completely implemented has
been added.

Since the error state of the MovieClip includes the final URL of the SWF
file obtained after any redirects, the load_error_swf and
movie_loader_error functions (now) take an swf_url attribute.
To get this URL in case no file could be loaded, the
NavigatorBackend::fetch method has been changed to return an
ErrorResponse struct (including the url and the actual error) in the
error case. The Response struct returned in the success case has been
renamed to SuccessResponse.
All fetch implementations have been adapted accordingly. Code has been
adjusted to return the actual error where that's needed.

Documentation has been added and improved.
2023-07-17 00:08:02 +02:00
.cargo web: Support pasting from clipboard 2023-05-21 15:26:42 +02:00
.github chore: Update wasm-bindgen from 0.2.86 -> 0.2.87 2023-06-15 20:50:04 +02:00
core core: Add MovieClip error state 2023-07-17 00:08:02 +02:00
desktop core: Add MovieClip error state 2023-07-17 00:08:02 +02:00
exporter chore(deps): lock file maintenance rust dependencies 2023-07-11 22:42:51 +02:00
flv chore(deps): lock file maintenance rust dependencies 2023-07-03 08:28:13 +03:00
render wgpu: Fix crash when not using push constants 2023-07-16 00:31:50 +02:00
ruffle_gc_arena Upgrade to new `gc-arena` API (#11182) 2023-07-09 17:04:25 -04:00
scanner chore(deps): lock file maintenance rust dependencies 2023-07-11 22:42:51 +02:00
swf core: Add MovieClip error state 2023-07-17 00:08:02 +02:00
tests core: Add MovieClip error state 2023-07-17 00:08:02 +02:00
video video/h263: Add a deblocking filter as a postprocessing step 2023-07-14 14:44:23 +02:00
web core: Add MovieClip error state 2023-07-17 00:08:02 +02:00
wstr core: use unified repr for non-static `AvmString`s, interned and not 2023-04-27 00:17:31 +02:00
.gitattributes chore: Cleanup .gitattributes 2021-02-19 16:28:09 -08:00
.gitignore chore: Cleanup .gitignore 2021-02-19 16:28:09 -08:00
CODE_OF_CONDUCT.md chore: Update CODE_OF_CONDUCT.md 2021-02-27 16:58:32 -08:00
CONTRIBUTING.md docs: Add detailed instructions for running tests 2023-05-31 21:32:51 +02:00
Cargo.lock avm1: Fix panic on writing self-referential SharedObjects 2023-07-15 11:45:02 +02:00
Cargo.toml chore(deps): lock file maintenance rust dependencies 2023-07-11 22:42:51 +02:00
LICENSE.md chore: Add symphonia attribution in LICENSE.md 2022-12-17 22:48:42 -08:00
PKGBUILD ci: Provide `sha512sums` in AUR package 2023-06-02 21:52:57 +03:00
README.md Add Table of Contents to README 2023-06-12 08:55:02 +03:00
crowdin.yml desktop: Localise texts 2023-05-24 23:50:48 +02:00
rustfmt.toml chore: Add rustfmt.toml and rustfmt pass 2019-08-26 16:38:48 -07:00

README.md

Ruffle

Rust Build Status Web Build Status Ruffle npm Ruffle AUR Ruffle Discord Ruffle translations
website | demo | nightly builds | wiki

Ruffle

Ruffle is an Adobe Flash Player emulator written in the Rust programming language. Ruffle targets both the desktop and the web using WebAssembly.

Table of Contents

Project status

Ruffle is in the proof-of-concept stage and can currently run early Flash animations and games. Basic ActionScript 1.0/2.0 support is in place and improving; ActionScript 3.0 support is forthcoming. For more info, read the project roadmap.

Using Ruffle

The easiest way to try out Ruffle is to visit the web demo page, then click the "Browse..." button to load an SWF file of your choice.

Nightly builds of Ruffle are available for desktop and web platforms including the browser extension.

For more detailed instructions, see our wiki page.

Building from source

Follow the official guide to install Rust for your platform.

You must also have Java installed, and available on your PATH as java.

Desktop

If you are building for a Linux platform, the following are typical dependencies:

Ubuntu

  • libasound2-dev
  • libxcb-shape0-dev
  • libxcb-xfixes0-dev
  • libgtk-3-dev
  • libssl-dev
  • libxcb-xinput-dev
  • libxcb-xkb-dev
  • libxcb-cursor-dev
  • default-jre-headless
  • cmake
  • g++

Use the following command to build and run the desktop app:

cargo run --release --package=ruffle_desktop

To run a specific SWF file, pass the SWF path as an argument:

cargo run --release --package=ruffle_desktop -- test.swf

To build in debug mode, simply omit --release from the command.

Homebrew

Ruffle Desktop can be built from our Homebrew Tap:

brew install --HEAD ruffle-rs/ruffle/ruffle

Note: because it is HEAD-only, you'll need to run brew upgrade --fetch-HEAD ruffle each time you want to update.

Web or Extension

Follow the instructions in the web directory for building either the web or browser extension version of Ruffle.

Scanner

If you have a collection of "real world" SWFs to test against, the scanner may be used to benchmark ruffle's parsing capabilities. Provided with a folder and an output filename, it will attempt to read all of the flash files and report on the success of such a task.

cargo run --release --package=ruffle_scanner -- folder/with/swfs/ results.csv

Exporter

If you have a swf and would like to capture an image of it, you may use the exporter tool. This currently requires hardware acceleration, but can be run headless (with no window).

  • cargo run --release --package=exporter -- path/to/file.swf
  • cargo run --release --package=exporter -- path/to/file.swf path/to/screenshots --frames 5

Structure

  • core contains the core emulator and common code
  • desktop contains the desktop client (uses wgpu-rs)
  • web contains the web client and browser extension (uses wasm-bindgen)
  • scanner contains a utility to bulk parse swf files
  • exporter contains a utility to generate PNG screenshots of a swf file

Sponsors

You can support the development of Ruffle via GitHub Sponsors. Your sponsorship will help to ensure the accessibility of Flash content for the future. Thank you!

Sincere thanks to the diamond level sponsors of Ruffle:

Newgrounds.com CPMStar Sébastien Bénard Crazy Games Cool Math Games The New York Times Armor Games Onda Educa TwoPlayerGames.org wowgame.jp Matt Roszak Doll Divine Movavi Kongregate Bubble Shooter

License

Ruffle is licensed under either of

at your option.

Ruffle depends on third-party libraries under compatible licenses. See LICENSE.md for full information.

Contributing

Ruffle welcomes contribution from everyone. See CONTRIBUTING.md for help getting started.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

The entire Ruffle community, including the chat room and GitHub project, is expected to abide by the Code of Conduct that the Rust project itself follows.