Skip to content

openrv-web / LoopAPI

Class: LoopAPI

Defined in: api/LoopAPI.ts:14

Extends

  • DisposableAPI

Constructors

Constructor

new LoopAPI(session): LoopAPI

Defined in: api/LoopAPI.ts:17

Parameters

session

Session

Returns

LoopAPI

Overrides

DisposableAPI.constructor

Methods

clearInOut()

clearInOut(): void

Defined in: api/LoopAPI.ts:139

Clear in/out points, resetting the playback range to the full source duration.

Returns

void

Example

ts
openrv.loop.clearInOut();

dispose()

dispose(): void

Defined in: api/Disposable.ts:19

Mark this sub-API as disposed. After this call, assertNotDisposed() will throw on every subsequent invocation.

Returns

void

Inherited from

DisposableAPI.dispose


getInPoint()

getInPoint(): number

Defined in: api/LoopAPI.ts:111

Get the current in point frame number.

Returns

number

The in point frame number (1-based).

Example

ts
const inPt = openrv.loop.getInPoint();

getMode()

getMode(): string

Defined in: api/LoopAPI.ts:52

Get the current loop mode.

Returns

string

The current loop mode: 'once', 'loop', or 'pingpong'.

Example

ts
const mode = openrv.loop.getMode(); // e.g. 'loop'

getOutPoint()

getOutPoint(): number

Defined in: api/LoopAPI.ts:126

Get the current out point frame number.

Returns

number

The out point frame number (1-based).

Example

ts
const outPt = openrv.loop.getOutPoint();

setInPoint()

setInPoint(frame): void

Defined in: api/LoopAPI.ts:68

Set the in point (start of playback range).

Parameters

frame

number

Frame number for the in point (1-based).

Returns

void

Throws

If frame is not a valid number or is NaN.

Example

ts
openrv.loop.setInPoint(10);

setMode()

setMode(mode): void

Defined in: api/LoopAPI.ts:34

Set the loop mode for playback.

Parameters

mode

string

One of 'once' (play once and stop), 'loop' (repeat from start), or 'pingpong' (alternate forward/backward).

Returns

void

Throws

If mode is not a recognized loop mode string.

Example

ts
openrv.loop.setMode('loop');

setOutPoint()

setOutPoint(frame): void

Defined in: api/LoopAPI.ts:90

Set the out point (end of playback range).

Parameters

frame

number

Frame number for the out point (1-based).

Returns

void

Throws

If frame is not a valid number or is NaN.

Example

ts
openrv.loop.setOutPoint(200);

Released under the MIT License.