Skip to content

openrv-web / OpenRVAPI

Class: OpenRVAPI

Defined in: api/OpenRVAPI.ts:46

The main OpenRV public API

Constructors

Constructor

new OpenRVAPI(config): OpenRVAPI

Defined in: api/OpenRVAPI.ts:92

Parameters

config

OpenRVAPIConfig

Returns

OpenRVAPI

Properties

audio

readonly audio: AudioAPI

Defined in: api/OpenRVAPI.ts:57

Audio control methods


color

readonly color: ColorAPI

Defined in: api/OpenRVAPI.ts:66

Color adjustment methods


events

readonly events: EventsAPI

Defined in: api/OpenRVAPI.ts:72

Event subscription methods


loop

readonly loop: LoopAPI

Defined in: api/OpenRVAPI.ts:60

Loop control methods


markers

readonly markers: MarkersAPI

Defined in: api/OpenRVAPI.ts:69

Marker management methods


media

readonly media: MediaAPI

Defined in: api/OpenRVAPI.ts:54

Media information methods


playback

readonly playback: PlaybackAPI

Defined in: api/OpenRVAPI.ts:51

Playback control methods


plugins

readonly plugins: object

Defined in: api/OpenRVAPI.ts:75

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>

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


version

readonly version: string = '1.0.0'

Defined in: api/OpenRVAPI.ts:48

API version following semver


view

readonly view: ViewAPI

Defined in: api/OpenRVAPI.ts:63

View control methods

Methods

dispose()

dispose(): void

Defined in: api/OpenRVAPI.ts:128

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:115

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(); }

Released under the MIT License.