Introduced in PennController 1.8, MediaRecorder elements let you collect audio and/or video samples after requesting access to a recording device. Note that browser support is limited, with Firefox desktop and Chrome desktop having the best support.
Creation:
newMediaRecorder("recorder", "audio")
If you don’t specify any parameter when creating the element, it will record an audio+video stream by default.
If print
is called, a feedback media player will be added to the page besides a Record button.
In order to collect recordings, you need to
- upload a PHP file on a server where you can store an archive of the sample files. See the page How to collect audio and/or video samples for instructions.
- initiate the recorder before creating a MediaRecorder element, by adding to your sequence a special initialization trial using InitiateRecorder and specifying the URL of your PHP file, e.g.
[js try=”data”]InitiateRecorder(“http://myserver/saveRecordings.php”);
newTrial(
newMediaRecorder(“recorder”, “audio”)
.print()
,
newButton(“send”, “Click here to send your recording.”)
.print()
.wait()
);[/js]
Commands
[yadawiki-list category=”NonTest command,MediaRecorder element”]
Tests
[yadawiki-list category=”Test command,MediaRecorder element”]
Index
- Tutorial
- Commands by element categories
- Standard Element Commands
- Audio element
- Button element
- Canvas element
- DropDown element
- EyeTracker element
- Function element
- Html element
- Image element
- Key element
- MediaRecorder element
- Scale element
- Selector element
- Text element
- TextInput element
- Timer element
- Tooltip element
- Var element
- Video element
- Youtube element
- Special clear command
- Special end command
- Global PennController Commands
- PennController
- PennController.AddHost
- PennController.AddTable
- PennController.CheckPreloaded
- PennController.Debug
- PennController.DownloadVoiceButton
- PennController.FeedItems
- PennController.Footer
- PennController.GetTable
- PennController.GetURLParameter
- PennController.Header
- PennController.InitiateRecorder
- PennController.PreloadZip
- PennController.ResetPrefix
- PennController.SendResults
- PennController.Sequence
- PennController.SetCounter
- PennController.Template
- Installing PennController
- Ontology
- Aesthetics
- Preloading resources
- ZIPped resources
- Spreadsheet (CSV)
- Canvas creation
- Setup for audio recordings collection