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
Returns
OpenRVAPI
Properties
audio
readonlyaudio:AudioAPI
Defined in: api/OpenRVAPI.ts:57
Audio control methods
color
readonlycolor:ColorAPI
Defined in: api/OpenRVAPI.ts:66
Color adjustment methods
events
readonlyevents:EventsAPI
Defined in: api/OpenRVAPI.ts:72
Event subscription methods
loop
readonlyloop:LoopAPI
Defined in: api/OpenRVAPI.ts:60
Loop control methods
markers
readonlymarkers:MarkersAPI
Defined in: api/OpenRVAPI.ts:69
Marker management methods
media
readonlymedia:MediaAPI
Defined in: api/OpenRVAPI.ts:54
Media information methods
playback
readonlyplayback:PlaybackAPI
Defined in: api/OpenRVAPI.ts:51
Playback control methods
plugins
readonlyplugins: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
Returns
void
version
readonlyversion:string='1.0.0'
Defined in: api/OpenRVAPI.ts:48
API version following semver
view
readonlyview: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
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
if (openrv.isReady()) { openrv.playback.play(); }