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