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
Returns
OpenRVAPI
Properties
audio
readonlyaudio:AudioAPI
Defined in: api/OpenRVAPI.ts:97
Audio control methods
color
readonlycolor:ColorAPI
Defined in: api/OpenRVAPI.ts:106
Color adjustment methods
events
readonlyevents:EventsAPI
Defined in: api/OpenRVAPI.ts:115
Event subscription methods
loop
readonlyloop:LoopAPI
Defined in: api/OpenRVAPI.ts:100
Loop control methods
markers
readonlymarkers:MarkersAPI
Defined in: api/OpenRVAPI.ts:109
Marker management methods
media
readonlymedia:MediaAPI
Defined in: api/OpenRVAPI.ts:94
Media information methods
playback
readonlyplayback:PlaybackAPI
Defined in: api/OpenRVAPI.ts:91
Playback control methods
plugins
readonlyplugins: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
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
readonlysequence:SequenceAPI
Defined in: api/OpenRVAPI.ts:112
Sequence inspection methods
version
readonlyversion:string=ENGINE_VERSION
Defined in: api/OpenRVAPI.ts:88
API version following semver, derived from package.json
view
readonlyview: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
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
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
openrv.onReady(() => { openrv.playback.play(); });