Skip to main content

Record:play()

Plays a touch record: one you recorded, or one a user recorded in a dialog's GestureRecorder.

Signature​

Record:play(recordName: string, params: RecordParams): void

Parameters​

ParametersTypeDescription
recordNamestringThe record's name, or the answer of a GestureRecorder
paramsRecordParamsOptional. RecordParams():setSpeed(n) and RecordParams():setDelay(ms)

Returns

void

Examples​

Record:play("daily-route", RecordParams():setSpeed(1):setDelay(3000))
Dialog:init()
Dialog:add(GestureRecorder(1, "Play your route once"))
Dialog:showIfNeeded()
Record:play(Dialog:getValueById(1), RecordParams():setSpeed(1.5))

Notes​

  • setSpeed(2) plays twice as fast; 0.5 half as fast.
  • setDelay(ms) waits that long after each action; when you don't set it, the wait is 3000 ms.
  • A recording from a GestureRecorder keeps the user's own pauses. setDelay(ms) above 0 replaces them with that fixed wait; 0 or no delay keeps them.
  • In the Block Editor, play touch record takes a record from its dropdown, or any text over it, such as answer of a touch recorder.