Construct the Ruffle public API.
+Do not use this function to negotiate a public API. Instead, use
+public_api
to register your Ruffle source with an existing public API
+if it exists.
Constructing a Public API will also trigger it to initialize Ruffle once +the page loads, if the API has not already been superseded.
+Optional
prev: null | PublicAPILikeWhat used to be in the public API slot.
+This is used to upgrade from a prior version of the public API, or from +a user-defined configuration object placed in the public API slot.
+The configuration object used when Ruffle is instantiated.
+The version of the public API.
+This is not the version of Ruffle itself.
+This allows a page with an old version of the Public API to be upgraded +to a new version of the API. The public API is intended to be changed +very infrequently, if at all, but this provides an escape mechanism for +newer Ruffle sources to upgrade older installations.
+The version of this public API.
+Negotiate and start Ruffle.
+This function reads the config parameter to determine which polyfills +should be enabled. If the configuration parameter is missing, then we +use a built-in set of defaults sufficient to fool sites with static +content and weak plugin detection.
+Look up a specific Ruffle version (or any version satisfying a given set +of requirements) and return it's API.
+A set of semantic version requirement +strings that the player version must satisfy.
+An instance of the Source API, if one or more +sources satisfied the requirement.
+Indicates that this version of the public API has been superseded by a +newer version.
+This should only be called by a newer version of the Public API. +Identical versions of the Public API should not supersede older versions +of that same API.
+Unfortunately, we can't disable polyfills after-the-fact, so this +only lets you disable the init event...
+Represents the various types of auto-play behaviours that are supported.
+The player should automatically play the movie as soon as it is loaded.
+If the browser does not support automatic audio, the movie will begin +muted.
+The player should not attempt to automatically play the movie.
+This will leave it to the user or API to actually play when appropriate.
+The player should automatically play the movie as soon as it is deemed +"appropriate" to do so.
+The exact behaviour depends on the browser, but commonly requires some +form of user interaction on the page in order to allow auto playing videos +with sound.
+Represents the various context menu options that are supported.
+The context menu should appear when right-clicking or long-pressing +the Ruffle instance.
+The context menu should only appear when right-clicking +the Ruffle instance.
+The context menu should not appear when right-clicking or long-pressing +the Ruffle instance.
+Controls whether the content is letterboxed or pillarboxed when the +player's aspect ratio does not match the movie's aspect ratio.
+When letterboxed, black bars will be rendered around the exterior +margins of the content.
+The networking API access mode of the Ruffle player.
+All networking APIs are permitted in the SWF file.
+The SWF file may not call browser navigation or browser interaction APIs.
+The APIs navigateToURL(), fscommand() and ExternalInterface.call() are +prevented in this mode.
+The SWF file may not call browser navigation or browser interaction APIs +and it cannot use any SWF-to-SWF communication APIs.
+Additionally to the ones in internal mode, the APIs sendToURL(), +FileReference.download(), FileReference.upload(), Loader.load(), +LocalConnection.connect(), LocalConnection.send(), NetConnection.connect(), +NetStream.play(), Security.loadPolicyFile(), SharedObject.getLocal(), +SharedObject.getRemote(), Socket.connect(), Sound.load(), URLLoader.load(), +URLStream.load() and XMLSocket.connect() are prevented in this mode.
+This mode is not implemented yet.
+The handling mode of links opening a new website.
+Represents the player runtime to emulate.
+The render backend of a Ruffle player.
+The available backends may change in future releases.
+An in-development API that will be preferred if available in the future. +Should behave the same as wgpu-webgl, except with lower overhead and thus better performance.
+The most featureful and currently preferred backend. +Rendering is done the same way as in the desktop app, then translated to WebGL on-the-fly.
+A vanilla WebGL backend. Was the default backend until the start of 2023, +but is now used as a fallback for devices that do not support WebGL 2. +Supports fewer features and has a faster initialization time; +may be useful for content that does not need advanced features like bitmap drawing or blend modes.
+The slowest and most basic backend, used as a fallback when all else fails. +However, this is currently the only backend that accurately scales hairline strokes. +If you notice excessively thick strokes in specific content, +you may want to use the canvas renderer for that content until the issue is resolved.
+When the player is muted, this controls whether or not Ruffle will show a +"click to unmute" overlay on top of the movie.
+The window mode of a Ruffle player.
+The Flash content is rendered in its own window and layering is done with the browser's +default behavior.
+In Ruffle, this mode functions like WindowMode::Opaque
and will layer the Flash content
+together with other HTML elements.
The Flash content is layered together with other HTML elements, and the stage color is +opaque. Content can render above or below Ruffle based on CSS rendering order.
+The Flash content is layered together with other HTML elements, and the SWF stage color is +transparent. Content beneath Ruffle will be visible through transparent areas.
+Request compositing with hardware acceleration when possible.
+This mode has no effect in Ruffle and will function like WindowMode.Opaque
.
Request a direct rendering path, bypassing browser compositing when possible.
+This mode has no effect in Ruffle and will function like WindowMode::Opaque
.
Install this version of Ruffle into the current page.
+Multiple (or zero) versions of Ruffle may be installed at the same time,
+and you should use window.RufflePlayer.newest()
or similar to access the appropriate
+installation at time of use.
The name of this particular +Ruffle source. Common convention is "local" for websites that bundle their own Ruffle, +"extension" for browser extensions, and something else for other use cases. +Names are unique, and last-installed will replace earlier installations with the same name, +regardless of what those installations are or which version they represent.
+Any options used to configure this specific installation of Ruffle.
+ruffle-core is the core javascript bindings to the Wasm ruffle-web binary, +and contains the actual public API.
+For more examples and in-depth documentation on how to use Ruffle on your website, please +check out our wiki.
+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.
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>
+
+
+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>
+
+
+Please see the ruffle-web README.
+Any options used for loading a movie.
+Optional
allowIf set to true, the movie is allowed to interact with the page through
+JavaScript, using a flash concept called ExternalInterface
.
This should only be enabled for movies you trust.
+Optional
parametersAlso known as "flashvars" - these are values that may be passed to +and loaded by the movie.
+If a URL if specified when loading the movie, some parameters will +be extracted by the query portion of that URL and then overwritten +by any explicitly set here.
+Optional
autoplayControls the auto-play behaviour of Ruffle.
+Optional
backgroundControls the background color of the player.
+Must be an HTML color (e.g. "#FFFFFF"). CSS colors are not allowed.
+null
uses the background color of the SWF file.
Optional
letterboxControls letterbox behavior when the Flash container size does not +match the movie size.
+Optional
unmuteControls the visibility of the unmute overlay when the player +is started muted.
+Optional
upgradeWhether or not to auto-upgrade all embedded URLs to https.
+Flash content that embeds http urls will be blocked from
+accessing those urls by the browser when Ruffle is loaded
+in a https context. Set to true
to automatically change
+http://
to https://
for all embedded URLs when Ruffle is
+loaded in an https context.
Optional
compatibilityEnable (true) or disable (false) Ruffle's built in compatibility rules.
+These are rules that may make some content work by deliberately changing +behaviour, for example by rewriting requests or spoofing SWF urls if they +rely on websites that no longer exist.
+Optional
favorFavor using the real Adobe Flash Player over Ruffle if the browser supports it.
+Optional
warnThis is no longer used and does not affect anything. +It is only kept for backwards compatibility.
+Previously: +"Whether or not to display an overlay with a warning when +loading a movie with unsupported content."
+Optional
logConsole logging level.
+Optional
showIf set to true, the context menu has an option to download +the SWF.
+Optional
contextWhether or not to show a context menu when right-clicking +a Ruffle instance.
+Optional
preloaderWhether or not to show a splash screen before the SWF has loaded with Ruffle (backwards-compatibility).
+Optional
splashWhether or not to show a splash screen before the SWF has loaded with Ruffle.
+Optional
maxMaximum amount of time a script can take before scripting +is disabled.
+Optional
baseSpecifies the base directory or URL used to resolve all relative path statements in the SWF file. +null means the current directory.
+Optional
menuIf set to true, the built-in context menu items are visible
+This is equivalent to Stage.showMenu.
+Optional
salignThis is equivalent to Stage.align.
+Optional
forceIf set to true, movies are prevented from changing the stage alignment.
+Optional
qualityThis is equivalent to Stage.quality.
+Optional
scaleThis is equivalent to Stage.scaleMode.
+Optional
forceIf set to true, movies are prevented from changing the stage scale mode.
+Optional
allowIf set to true, the Stage's displayState can be changed
+Optional
frameSets and locks the player's frame rate, overriding the movie's frame rate.
+Optional
wmodeThe window mode of the Ruffle player.
+This setting controls how the Ruffle container is layered and rendered with other content on the page.
+Optional
playerThe emulated version of the player.
+This controls the version that is reported to the movie. +null means latest version.
+Optional
preferredThe preferred render backend of the Ruffle player.
+This option should only be used for testing; +the available backends may change in future releases. +By default, Ruffle chooses the most featureful backend supported by the user's system, +falling back to more basic backends if necessary. +The available values in order of default preference are: +"webgpu", "wgpu-webgl", "webgl", "canvas".
+Optional
publicThe URL at which Ruffle can load its extra files (i.e. .wasm
).
Optional
polyfillsWhether or not to enable polyfills on the page.
+Polyfills will look for "legacy" flash content like <object>
+and <embed>
elements, and replace them with compatible
+Ruffle elements.
Optional
openThe handling mode of links opening a new website.
+Optional
allowWhich flash networking APIs may be accessed.
+Optional
openA function to call for opening content in a new tab.
+This is only used if the content cannot be loaded due to CORS, +and the Extension version of Ruffle will override this to provide a local player.
+Optional
socketAn array of SocketProxy objects.
+When a SWF tries to establish a Socket connection, Ruffle will search for +a matching SocketProxy object in this array and use it to establish a WebSocket connection, +through which all communication is tunneled through.
+When none are found, Ruffle will fail the connection gracefully. +When multiple matching SocketProxy objects exist, the first one is used.
+Optional
fontAn array of font URLs to eagerly load and provide to Ruffle.
+These will be fetched by the browser as part of the loading of Flash content, which may slow down load times.
+Currently only SWFs are supported, and each font embedded within that SWF will be used as device font by Flash content.
+If any URL fails to load (either it's an invalid file, or a network error occurs), Ruffle will log an error but continue without it.
+Optional
defaultThe font names to use for each "default" Flash device font.
+Optional
credentialAn array of origins that credentials may be sent to. +Credentials are cookies, authorization headers, or TLS client certificates.
+Entries should include the protocol and host, for example https://example.org
or http://subdomain.example.org
.
Cookies will always be sent to the same origin as the page the content was loaded on. +If you configure this to send cookies to an origin but that origin does not configure CORS to allow it, +then requests will start failing due to CORS. +See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials.
+This directly corresponds to https://developer.mozilla.org/en-US/docs/Web/API/fetch#credentials
+Every request will be same-origin
unless specified here, in which case it will be include
.
Optional
playerThe player runtime to emulate
+This allows you to emulate Adobe AIR or Adobe Flash Player.
+Options to load a movie by a data stream.
+The data to load a movie from.
+Optional
swfThe filename of the SWF movie to provide to ActionScript.
+Optional
allowIf set to true, the movie is allowed to interact with the page through
+JavaScript, using a flash concept called ExternalInterface
.
This should only be enabled for movies you trust.
+Optional
parametersAlso known as "flashvars" - these are values that may be passed to +and loaded by the movie.
+If a URL if specified when loading the movie, some parameters will +be extracted by the query portion of that URL and then overwritten +by any explicitly set here.
+Optional
autoplayControls the auto-play behaviour of Ruffle.
+Optional
backgroundControls the background color of the player.
+Must be an HTML color (e.g. "#FFFFFF"). CSS colors are not allowed.
+null
uses the background color of the SWF file.
Optional
letterboxControls letterbox behavior when the Flash container size does not +match the movie size.
+Optional
unmuteControls the visibility of the unmute overlay when the player +is started muted.
+Optional
upgradeWhether or not to auto-upgrade all embedded URLs to https.
+Flash content that embeds http urls will be blocked from
+accessing those urls by the browser when Ruffle is loaded
+in a https context. Set to true
to automatically change
+http://
to https://
for all embedded URLs when Ruffle is
+loaded in an https context.
Optional
compatibilityEnable (true) or disable (false) Ruffle's built in compatibility rules.
+These are rules that may make some content work by deliberately changing +behaviour, for example by rewriting requests or spoofing SWF urls if they +rely on websites that no longer exist.
+Optional
favorFavor using the real Adobe Flash Player over Ruffle if the browser supports it.
+Optional
warnThis is no longer used and does not affect anything. +It is only kept for backwards compatibility.
+Previously: +"Whether or not to display an overlay with a warning when +loading a movie with unsupported content."
+Optional
logConsole logging level.
+Optional
showIf set to true, the context menu has an option to download +the SWF.
+Optional
contextWhether or not to show a context menu when right-clicking +a Ruffle instance.
+Optional
preloaderWhether or not to show a splash screen before the SWF has loaded with Ruffle (backwards-compatibility).
+Optional
splashWhether or not to show a splash screen before the SWF has loaded with Ruffle.
+Optional
maxMaximum amount of time a script can take before scripting +is disabled.
+Optional
baseSpecifies the base directory or URL used to resolve all relative path statements in the SWF file. +null means the current directory.
+Optional
menuIf set to true, the built-in context menu items are visible
+This is equivalent to Stage.showMenu.
+Optional
salignThis is equivalent to Stage.align.
+Optional
forceIf set to true, movies are prevented from changing the stage alignment.
+Optional
qualityThis is equivalent to Stage.quality.
+Optional
scaleThis is equivalent to Stage.scaleMode.
+Optional
forceIf set to true, movies are prevented from changing the stage scale mode.
+Optional
allowIf set to true, the Stage's displayState can be changed
+Optional
frameSets and locks the player's frame rate, overriding the movie's frame rate.
+Optional
wmodeThe window mode of the Ruffle player.
+This setting controls how the Ruffle container is layered and rendered with other content on the page.
+Optional
playerThe emulated version of the player.
+This controls the version that is reported to the movie. +null means latest version.
+Optional
preferredThe preferred render backend of the Ruffle player.
+This option should only be used for testing; +the available backends may change in future releases. +By default, Ruffle chooses the most featureful backend supported by the user's system, +falling back to more basic backends if necessary. +The available values in order of default preference are: +"webgpu", "wgpu-webgl", "webgl", "canvas".
+Optional
publicThe URL at which Ruffle can load its extra files (i.e. .wasm
).
Optional
polyfillsWhether or not to enable polyfills on the page.
+Polyfills will look for "legacy" flash content like <object>
+and <embed>
elements, and replace them with compatible
+Ruffle elements.
Optional
openThe handling mode of links opening a new website.
+Optional
allowWhich flash networking APIs may be accessed.
+Optional
openA function to call for opening content in a new tab.
+This is only used if the content cannot be loaded due to CORS, +and the Extension version of Ruffle will override this to provide a local player.
+Optional
socketAn array of SocketProxy objects.
+When a SWF tries to establish a Socket connection, Ruffle will search for +a matching SocketProxy object in this array and use it to establish a WebSocket connection, +through which all communication is tunneled through.
+When none are found, Ruffle will fail the connection gracefully. +When multiple matching SocketProxy objects exist, the first one is used.
+Optional
fontAn array of font URLs to eagerly load and provide to Ruffle.
+These will be fetched by the browser as part of the loading of Flash content, which may slow down load times.
+Currently only SWFs are supported, and each font embedded within that SWF will be used as device font by Flash content.
+If any URL fails to load (either it's an invalid file, or a network error occurs), Ruffle will log an error but continue without it.
+Optional
defaultThe font names to use for each "default" Flash device font.
+Optional
credentialAn array of origins that credentials may be sent to. +Credentials are cookies, authorization headers, or TLS client certificates.
+Entries should include the protocol and host, for example https://example.org
or http://subdomain.example.org
.
Cookies will always be sent to the same origin as the page the content was loaded on. +If you configure this to send cookies to an origin but that origin does not configure CORS to allow it, +then requests will start failing due to CORS. +See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials.
+This directly corresponds to https://developer.mozilla.org/en-US/docs/Web/API/fetch#credentials
+Every request will be same-origin
unless specified here, in which case it will be include
.
Optional
playerThe player runtime to emulate
+This allows you to emulate Adobe AIR or Adobe Flash Player.
+Defines the names of the fonts to use for each "default" Flash device font.
+The name of each font provided will be used, in priority order.
+For example, defining sans: ["Helvetica", "Arial"]
would use Helvetica if present, before trying Arial.
Optional
sans_sans
, a Sans-Serif font (similar to Helvetica or Arial)
Optional
serif_serif
, a Serif font (similar to Times Roman)
Optional
typewriter_typewriter
, a Monospace font (similar to Courier)
Optional
japanese_ゴシック
, a Japanese Gothic font
Optional
japanese_等幅
, a Japanese Gothic Mono font
Optional
japanese_明朝
, a Japanese Mincho font
Deprecated duration type, use SecsDuration instead. +Based on https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.new .
+Represents a host, port and proxyUrl. Used when a SWF file tries to use a Socket.
+Options to load a movie by URL.
+The URL to load a movie from.
+If there is a query portion of this URL, then default parameters +will be extracted from that.
+Optional
allowIf set to true, the movie is allowed to interact with the page through
+JavaScript, using a flash concept called ExternalInterface
.
This should only be enabled for movies you trust.
+Optional
parametersAlso known as "flashvars" - these are values that may be passed to +and loaded by the movie.
+If a URL if specified when loading the movie, some parameters will +be extracted by the query portion of that URL and then overwritten +by any explicitly set here.
+Optional
autoplayControls the auto-play behaviour of Ruffle.
+Optional
backgroundControls the background color of the player.
+Must be an HTML color (e.g. "#FFFFFF"). CSS colors are not allowed.
+null
uses the background color of the SWF file.
Optional
letterboxControls letterbox behavior when the Flash container size does not +match the movie size.
+Optional
unmuteControls the visibility of the unmute overlay when the player +is started muted.
+Optional
upgradeWhether or not to auto-upgrade all embedded URLs to https.
+Flash content that embeds http urls will be blocked from
+accessing those urls by the browser when Ruffle is loaded
+in a https context. Set to true
to automatically change
+http://
to https://
for all embedded URLs when Ruffle is
+loaded in an https context.
Optional
compatibilityEnable (true) or disable (false) Ruffle's built in compatibility rules.
+These are rules that may make some content work by deliberately changing +behaviour, for example by rewriting requests or spoofing SWF urls if they +rely on websites that no longer exist.
+Optional
favorFavor using the real Adobe Flash Player over Ruffle if the browser supports it.
+Optional
warnThis is no longer used and does not affect anything. +It is only kept for backwards compatibility.
+Previously: +"Whether or not to display an overlay with a warning when +loading a movie with unsupported content."
+Optional
logConsole logging level.
+Optional
showIf set to true, the context menu has an option to download +the SWF.
+Optional
contextWhether or not to show a context menu when right-clicking +a Ruffle instance.
+Optional
preloaderWhether or not to show a splash screen before the SWF has loaded with Ruffle (backwards-compatibility).
+Optional
splashWhether or not to show a splash screen before the SWF has loaded with Ruffle.
+Optional
maxMaximum amount of time a script can take before scripting +is disabled.
+Optional
baseSpecifies the base directory or URL used to resolve all relative path statements in the SWF file. +null means the current directory.
+Optional
menuIf set to true, the built-in context menu items are visible
+This is equivalent to Stage.showMenu.
+Optional
salignThis is equivalent to Stage.align.
+Optional
forceIf set to true, movies are prevented from changing the stage alignment.
+Optional
qualityThis is equivalent to Stage.quality.
+Optional
scaleThis is equivalent to Stage.scaleMode.
+Optional
forceIf set to true, movies are prevented from changing the stage scale mode.
+Optional
allowIf set to true, the Stage's displayState can be changed
+Optional
frameSets and locks the player's frame rate, overriding the movie's frame rate.
+Optional
wmodeThe window mode of the Ruffle player.
+This setting controls how the Ruffle container is layered and rendered with other content on the page.
+Optional
playerThe emulated version of the player.
+This controls the version that is reported to the movie. +null means latest version.
+Optional
preferredThe preferred render backend of the Ruffle player.
+This option should only be used for testing; +the available backends may change in future releases. +By default, Ruffle chooses the most featureful backend supported by the user's system, +falling back to more basic backends if necessary. +The available values in order of default preference are: +"webgpu", "wgpu-webgl", "webgl", "canvas".
+Optional
publicThe URL at which Ruffle can load its extra files (i.e. .wasm
).
Optional
polyfillsWhether or not to enable polyfills on the page.
+Polyfills will look for "legacy" flash content like <object>
+and <embed>
elements, and replace them with compatible
+Ruffle elements.
Optional
openThe handling mode of links opening a new website.
+Optional
allowWhich flash networking APIs may be accessed.
+Optional
openA function to call for opening content in a new tab.
+This is only used if the content cannot be loaded due to CORS, +and the Extension version of Ruffle will override this to provide a local player.
+Optional
socketAn array of SocketProxy objects.
+When a SWF tries to establish a Socket connection, Ruffle will search for +a matching SocketProxy object in this array and use it to establish a WebSocket connection, +through which all communication is tunneled through.
+When none are found, Ruffle will fail the connection gracefully. +When multiple matching SocketProxy objects exist, the first one is used.
+Optional
fontAn array of font URLs to eagerly load and provide to Ruffle.
+These will be fetched by the browser as part of the loading of Flash content, which may slow down load times.
+Currently only SWFs are supported, and each font embedded within that SWF will be used as device font by Flash content.
+If any URL fails to load (either it's an invalid file, or a network error occurs), Ruffle will log an error but continue without it.
+Optional
defaultThe font names to use for each "default" Flash device font.
+Optional
credentialAn array of origins that credentials may be sent to. +Credentials are cookies, authorization headers, or TLS client certificates.
+Entries should include the protocol and host, for example https://example.org
or http://subdomain.example.org
.
Cookies will always be sent to the same origin as the page the content was loaded on. +If you configure this to send cookies to an origin but that origin does not configure CORS to allow it, +then requests will start failing due to CORS. +See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials.
+This directly corresponds to https://developer.mozilla.org/en-US/docs/Web/API/fetch#credentials
+Every request will be same-origin
unless specified here, in which case it will be include
.
Optional
playerThe player runtime to emulate
+This allows you to emulate Adobe AIR or Adobe Flash Player.
+These are properties and methods that Flash added to its <embed>/<object>
tags.
+These don't seem to be documented in full anywhere, and Ruffle adds them as we encounter some.
+You are discouraged from using these, and they exist only to support legacy websites from decades ago.
Extra methods or properties may appear at any time, due to ExternalInterface.addCallback()
.
+It may even overwrite existing methods or properties.
Legacy interface to the Ruffle API.
+These methods are deprecated and only exist for backwards compatibility.
+Due to the nature of Flash, they may be replaced at any time via ActionScript's ExternalInterface
class.
A movie can communicate with the hosting page using fscommand +as long as script access is allowed.
+Any configuration that should apply to this specific player. +This will be defaulted with any global configuration.
+Readonly
loadedThe effective config loaded with the last call to load()
.
+If no such call has been made, this will be null
.
Indicates the readiness of the playing movie.
+The ReadyState
of the player.
The metadata of the playing movie (such as movie width and height).
+These are inherent properties stored in the SWF file and are not affected by runtime changes.
+For example, metadata.width
is the width of the SWF file, and not the width of the Ruffle player.
The metadata of the movie, or null
if the movie metadata has not yet loaded.
Whether this player is currently playing.
+True if this player is playing, false if it's paused or hasn't started yet.
+Returns the master volume of the player.
+The volume is linear and not adapted for logarithmic hearing.
+The volume. 1.0 is 100% volume.
+Sets the master volume of the player.
+The volume should be linear and not adapted for logarithmic hearing.
+The volume. 1.0 is 100% volume.
+Checks if this player is allowed to be fullscreen by the browser.
+True if you may call enterFullscreen.
+Checks if this player is currently fullscreen inside the browser.
+True if it is fullscreen.
+Sets a trace observer on this flash player.
+The observer will be called, as a function, for each message that the playing movie will "trace" (output).
+The observer that will be called for each trace.
+Loads a specified movie into this player.
+This will replace any existing movie that may be playing.
+One of the following:
+The options will be defaulted by the config field, which itself
+is defaulted by a global window.RufflePlayer.config
.
Requests the browser to make this player fullscreen.
+This is not guaranteed to succeed, please check fullscreenEnabled first.
+Metadata about a loaded SWF file.
+Readonly
widthThe width of the movie in pixels.
+Readonly
heightThe height of the movie in pixels.
+Readonly
frameThe frame rate of the movie in frames per second.
+Readonly
numThe number of frames on the root timeline of the movie.
+Readonly
swfThe SWF version of the movie.
+Readonly
backgroundThe background color of the movie as a hex string, such as "#FFFFFF".
+May be null
if the background color is unavailable.
Readonly
isWhether this movie is an ActionScript 3.0 movie.
+Readonly
uncompressedUncompressed length in bytes.
+A Ruffle player's HTML element.
+This is either created through window.RufflePlayer.latest().createPlayer()
, or polyfilled from a <embed>
/<object>
tag.
In addition to usual HTML attributes, this player contains methods and properties that belong to both +the Flash JS API and legacy Ruffle APIs.
+A movie can communicate with the hosting page using fscommand +as long as script access is allowed.
+Any configuration that should apply to this specific player. +This will be defaulted with any global configuration.
+Readonly
loadedThe effective config loaded with the last call to load()
.
+If no such call has been made, this will be null
.
Indicates the readiness of the playing movie.
+The ReadyState
of the player.
The metadata of the playing movie (such as movie width and height).
+These are inherent properties stored in the SWF file and are not affected by runtime changes.
+For example, metadata.width
is the width of the SWF file, and not the width of the Ruffle player.
The metadata of the movie, or null
if the movie metadata has not yet loaded.
Whether this player is currently playing.
+True if this player is playing, false if it's paused or hasn't started yet.
+Returns the master volume of the player.
+The volume is linear and not adapted for logarithmic hearing.
+The volume. 1.0 is 100% volume.
+Sets the master volume of the player.
+The volume should be linear and not adapted for logarithmic hearing.
+The volume. 1.0 is 100% volume.
+Checks if this player is allowed to be fullscreen by the browser.
+True if you may call enterFullscreen.
+Checks if this player is currently fullscreen inside the browser.
+True if it is fullscreen.
+Sets a trace observer on this flash player.
+The observer will be called, as a function, for each message that the playing movie will "trace" (output).
+The observer that will be called for each trace.
+Loads a specified movie into this player.
+This will replace any existing movie that may be playing.
+One of the following:
+The options will be defaulted by the config field, which itself
+is defaulted by a global window.RufflePlayer.config
.
Requests the browser to make this player fullscreen.
+This is not guaranteed to succeed, please check fullscreenEnabled first.
+Options to use with this specific installation of Ruffle.
+This is mostly to provide a way to configure environmental settings, like using
+onFirstLoad
to potentially configure webpack prior to loading wasm files.
Represents this particular version of Ruffle.
+Multiple APIs can be instantiated from different sources; e.g. an "extension" +version, versus a "local" version. This expresses to the Public API +negotiator (see PublicAPI) what this particular version of Ruffle is and +how to control it.
+The version of this particular API, as a string in a semver compatible format.
+Create a Ruffle player element using this particular version of Ruffle.
+The player element. This is a DOM element that may be inserted +into the current page as you wish.
+The Config module contains all the types that Ruffle uses for movie configs.
+The main interface of interest here is BaseLoadOptions, which you can apply to window.RufflePlayer.config
+to set the default configuration of all players.
The Player module contains the actual PlayerElement and the various interfaces that exist to interact with the player.
+The Setup module contains the interfaces and methods needed to install Ruffle onto a page, +and create a PlayerElement with the latest version of Ruffle available.
+This is primarily relevant to users of ruffle-core
as a npm module, as the "selfhosted" version of Ruffle preinstalls itself,
+and without type checking the interfaces here are of limited use.
For users of ruffle-core
as a npm module, you are encouraged to call installRuffle once during page load to
+make the ruffle-core
library register itself as a version of Ruffle on the page.
Multiple sources of Ruffle may exist - for example, the Ruffle browser extension also installs itself on page load.
+For this reason, you are required to call window.RufflePlayer.latest()
(for example) to grab the latest SourceAPI,
+from which you can create a PlayerElement via SourceAPI.createPlayer.
Any new duration-based setting should use 'number' or 'SecsDuration' for its type, +instead of this type.
+Non-negative duration in seconds.
+Const
Const
Stores build information about this specific version of the ruffle-core
library.
It does not represent the version of Ruffle that may be in use by the page (for example, if a browser extension overrides it).
+
Represents the Ruffle public API.
+The public API exists primarily to allow multiple installations of Ruffle on a +page (e.g. an extension install and a local one) to cooperate. In an ideal +situation, all Ruffle sources on the page install themselves into a single +public API, and then the public API picks the newest version by default.
+This API is versioned, in case we need to upgrade it. However, it must be +backwards- and forwards-compatible with all known sources.
+