Skip to content

openrv-web / OpenRVAPI

Class: OpenRVAPI

Defined in: api/OpenRVAPI.ts:86

The main OpenRV public API

Constructors

Constructor

new OpenRVAPI(config): OpenRVAPI

Defined in: api/OpenRVAPI.ts:174

Parameters

config

OpenRVAPIConfig

Returns

OpenRVAPI

Properties

audio

readonly audio: AudioAPI

Defined in: api/OpenRVAPI.ts:97

Audio control methods


color

readonly color: ColorAPI

Defined in: api/OpenRVAPI.ts:106

Color adjustment methods


events

readonly events: EventsAPI

Defined in: api/OpenRVAPI.ts:115

Event subscription methods


loop

readonly loop: LoopAPI

Defined in: api/OpenRVAPI.ts:100

Loop control methods


markers

readonly markers: MarkersAPI

Defined in: api/OpenRVAPI.ts:109

Marker management methods


media

readonly media: MediaAPI

Defined in: api/OpenRVAPI.ts:94

Media information methods


playback

readonly playback: PlaybackAPI

Defined in: api/OpenRVAPI.ts:91

Playback control methods


plugins

readonly plugins: object

Defined in: api/OpenRVAPI.ts:118

Plugin management

activate()

activate: (id) => Promise<void>

Activate a registered plugin

Parameters
id

string

Returns

Promise<void>

deactivate()

deactivate: (id) => Promise<void>

Deactivate an active plugin

Parameters
id

string

Returns

Promise<void>

dispose()

dispose: (id) => Promise<void>

Dispose a plugin (deactivate + run cleanup; must unregister before re-registering)

Parameters
id

string

Returns

Promise<void>

getState()

getState: (id) => PluginState | undefined

Get current state of a plugin

Parameters
id

string

Returns

PluginState | undefined

list()

list: () => string[]

List all registered plugin IDs

Returns

string[]

loadFromURL()

loadFromURL: (url) => Promise<string>

Load and register a plugin from a URL

Parameters
url

string

Returns

Promise<string>

register()

register: (plugin) => void

Register a plugin object

Parameters
plugin

Plugin

Returns

void

unregister()

unregister: (id) => void

Unregister a disposed plugin, removing it entirely so it can be re-registered

Parameters
id

string

Returns

void


sequence

readonly sequence: SequenceAPI

Defined in: api/OpenRVAPI.ts:112

Sequence inspection methods


version

readonly version: string = ENGINE_VERSION

Defined in: api/OpenRVAPI.ts:88

API version following semver, derived from package.json


view

readonly view: ViewAPI

Defined in: api/OpenRVAPI.ts:103

View control methods

Methods

dispose()

dispose(): void

Defined in: api/OpenRVAPI.ts:260

Clean up all listeners and resources. After calling this, the API instance should not be used (isReady() will return false).

Returns

void

Example

ts
openrv.dispose();

isReady()

isReady(): boolean

Defined in: api/OpenRVAPI.ts:247

Check if the API is initialized and ready for use.

Returns

boolean

true once the constructor has completed, false after dispose is called.

Example

ts
if (openrv.isReady()) { openrv.playback.play(); }

markReady()

markReady(): void

Defined in: api/OpenRVAPI.ts:209

Mark the API as ready for use.

Called by the bootstrap sequence after all async mount-time initialization has completed (persistence, URL bootstrap, etc.). External consumers should not call this method directly.

Returns

void


onReady()

onReady(callback): void

Defined in: api/OpenRVAPI.ts:229

Register a one-time callback that fires when the API becomes ready. If the API is already ready, the callback fires synchronously.

Parameters

callback

() => void

Function to invoke when the API is ready.

Returns

void

Example

ts
openrv.onReady(() => { openrv.playback.play(); });

Released under the MIT License.