mediarecorder.stop

getMediaRecorder(id).stop() (since PennController 1.8)

Stops recording / playing the latest sample.

Example:

[js highlight=”12,22″ try=”data”]InitiateRecorder(“https://myserver/upload.php”);

newTrial(
newMediaRecorder(“recorder”)
.record()
,
newTimer(“recording”, 3000)
.start()
.wait()
,
getMediaRecorder(“recorder”)
.stop()
.disable()
.print()
.play()
,
newTimer(“preview”, 1000)
.start()
.wait()
,
getMediaRecorder(“recorder”)
.stop()
);[/js]

Will start recording a video and stop recording after 2s, then play back the first second of the recording and stop the playback.

Published by Jeremy

Researcher in semantics and pragmatics; Programmer of PennController for IBEX