@lookit/record 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -85
- package/dist/index.browser.js +80 -349
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.min.js +2 -2
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.cjs +79 -348
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +79 -348
- package/dist/index.js.map +1 -1
- package/dist/stop.d.ts +15 -4
- package/dist/{video_config.d.ts → videoConfig.d.ts} +36 -20
- package/package.json +2 -7
- package/src/index.spec.ts +6 -2
- package/src/index.ts +1 -1
- package/src/stop.ts +11 -6
- package/src/{video_config.spec.ts → videoConfig.spec.ts} +70 -85
- package/src/{video_config.ts → videoConfig.ts} +70 -72
- package/src/{video_config_mic_check.spec.ts → videoConfig_mic_check.spec.ts} +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
This package contains the plugins and extensions to record audio and/or video of
|
|
4
4
|
either a single trial or multiple trials.
|
|
5
5
|
|
|
6
|
+
## Parameters available in all plugins
|
|
7
|
+
|
|
8
|
+
**`locale` [String | "en-us"]**
|
|
9
|
+
|
|
10
|
+
Optional parameter to set a two-letter language code for translation. In some
|
|
11
|
+
cases, a regional code will have to be provided as well. For example, we
|
|
12
|
+
currently support English only from the US region. Therefore, to get the US
|
|
13
|
+
English translation you would put "en-US" for the locale. We support the
|
|
14
|
+
following language codes:
|
|
15
|
+
|
|
16
|
+
| Language | Region | Code |
|
|
17
|
+
| -------------- | ------ | ----- |
|
|
18
|
+
| Basque | | eu |
|
|
19
|
+
| Dutch, Flemish | | nl |
|
|
20
|
+
| English | U.S.A. | en-US |
|
|
21
|
+
| French | | fr |
|
|
22
|
+
| Hungarian | | hu |
|
|
23
|
+
| Italian | | it |
|
|
24
|
+
| Japanese | | ja |
|
|
25
|
+
| Portuguese | Brazil | pt-BR |
|
|
26
|
+
| Portuguese | | pt |
|
|
27
|
+
|
|
6
28
|
## Video Configuration
|
|
7
29
|
|
|
8
30
|
To record _any_ video during an experiment, including a consent video, you must
|
|
@@ -39,69 +61,6 @@ const videoConfig = {
|
|
|
39
61
|
};
|
|
40
62
|
```
|
|
41
63
|
|
|
42
|
-
## Trial Recording
|
|
43
|
-
|
|
44
|
-
To record a single trial, you will have to first load the extension in
|
|
45
|
-
`initJsPsych`.
|
|
46
|
-
|
|
47
|
-
```javascript
|
|
48
|
-
const jsPsych = initJsPsych({
|
|
49
|
-
extensions: [{ type: chsRecord.TrialRecordExtension }],
|
|
50
|
-
});
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Next, create a video configuration trial as described above. Then, add the trial
|
|
54
|
-
recoding extension parameter to your trial. By adding this extension, you can
|
|
55
|
-
record any trial you design.
|
|
56
|
-
|
|
57
|
-
```javascript
|
|
58
|
-
const trialRec = {
|
|
59
|
-
// ... Other trial paramters ...
|
|
60
|
-
extensions: [{ type: chsRecord.TrialRecordExtension }],
|
|
61
|
-
};
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Finally, insert the trials into the timeline.
|
|
65
|
-
|
|
66
|
-
```javascript
|
|
67
|
-
jsPsych.run([videoConfig, trialRec]);
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Session Recording
|
|
71
|
-
|
|
72
|
-
You might prefer to record across multiple trials in a study session. This can
|
|
73
|
-
be done by using trials created with the start and stop recording plugins. This
|
|
74
|
-
gives a bit of flexibility over which of the study trials are recorded.
|
|
75
|
-
|
|
76
|
-
To record a study session, create the start and stop recording trials.
|
|
77
|
-
|
|
78
|
-
```javascript
|
|
79
|
-
const startRec = { type: chsRecord.StartRecordPlugin };
|
|
80
|
-
const stopRec = { type: chsRecord.StopRecordPlugin };
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Next, create the trials that you would like to be recorded.
|
|
84
|
-
|
|
85
|
-
```javascript
|
|
86
|
-
const morning = { type: jsPsychHtmlKeyboardResponse, stimulus: "Good morning!" };
|
|
87
|
-
const evening = { type: jsPsychHtmlKeyboardResponse stimulus: "Good evening!" };
|
|
88
|
-
const night = { type: jsPsychHtmlKeyboardResponse, stimulus: "Good night!" };
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Lastly, add these trials to the timeline. Again, the video configuration trial
|
|
92
|
-
must come before any other recording trials.
|
|
93
|
-
|
|
94
|
-
```javascript
|
|
95
|
-
jsPsych.run([videoConfig, startRec, morning, evening, night, stopRec]);
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
It's possible to record only some of the trials. This can be done by moving the
|
|
99
|
-
stop or start recording trials within the timeline.
|
|
100
|
-
|
|
101
|
-
```javascript
|
|
102
|
-
jsPsych.run([videoConfig, startRec, morning, evening, stopRec, night]);
|
|
103
|
-
```
|
|
104
|
-
|
|
105
64
|
## Video Consent
|
|
106
65
|
|
|
107
66
|
Users will need to record themselves accepting the consent document for your
|
|
@@ -212,31 +171,11 @@ whether babies love cats because of their soft fur or their twitchy tails.”
|
|
|
212
171
|
|
|
213
172
|
#### Optional
|
|
214
173
|
|
|
215
|
-
**`
|
|
216
|
-
|
|
217
|
-
Optional parameter to set a two-letter language code for translation. In some
|
|
218
|
-
cases, a regional code will have to be provided as well. For example, we
|
|
219
|
-
currently support english only from the US region. Therefore, to get the US
|
|
220
|
-
english translation you would put "en-US" for the locale. We support the
|
|
221
|
-
following language codes:
|
|
222
|
-
|
|
223
|
-
| Language | Region | Code |
|
|
224
|
-
| -------------- | ------ | ----- |
|
|
225
|
-
| Basque | | eu |
|
|
226
|
-
| Dutch, Flemish | | nl |
|
|
227
|
-
| English | U.S.A. | en-US |
|
|
228
|
-
| French | | fr |
|
|
229
|
-
| Hungarian | | hu |
|
|
230
|
-
| Italian | | it |
|
|
231
|
-
| Japanese | | ja |
|
|
232
|
-
| Portuguese | Brazil | pt-BR |
|
|
233
|
-
| Portuguese | | pt |
|
|
234
|
-
|
|
235
|
-
**`template` [String | "consent_005"]**
|
|
174
|
+
**`template` [String | "consent-template-5"]**
|
|
236
175
|
|
|
237
176
|
Which consent document template to use. If you are setting up a new study, we
|
|
238
177
|
recommend using the most recent (highest number) of these options. Options:
|
|
239
|
-
`
|
|
178
|
+
`consent-template-5`, `consent-garden`.
|
|
240
179
|
|
|
241
180
|
**`additional_video_privacy_statement` [String | ""]**
|
|
242
181
|
|
|
@@ -388,3 +327,66 @@ Replace the default spoken consent statement with your custom text.
|
|
|
388
327
|
|
|
389
328
|
Whether to omit the phrase “or in the very unlikely event of a research-related
|
|
390
329
|
injury” from the contact section. (This was required by the Northwestern IRB.)
|
|
330
|
+
|
|
331
|
+
## Trial Recording
|
|
332
|
+
|
|
333
|
+
To record a single trial, you will have to first load the extension in
|
|
334
|
+
`initJsPsych`.
|
|
335
|
+
|
|
336
|
+
```javascript
|
|
337
|
+
const jsPsych = initJsPsych({
|
|
338
|
+
extensions: [{ type: chsRecord.TrialRecordExtension }],
|
|
339
|
+
});
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Next, create a video configuration trial as described above. Then, add the trial
|
|
343
|
+
recoding extension parameter to your trial. By adding this extension, you can
|
|
344
|
+
record any trial you design.
|
|
345
|
+
|
|
346
|
+
```javascript
|
|
347
|
+
const trialRec = {
|
|
348
|
+
// ... Other trial paramters ...
|
|
349
|
+
extensions: [{ type: chsRecord.TrialRecordExtension }],
|
|
350
|
+
};
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Finally, insert the trials into the timeline.
|
|
354
|
+
|
|
355
|
+
```javascript
|
|
356
|
+
jsPsych.run([videoConfig, trialRec]);
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
## Session Recording
|
|
360
|
+
|
|
361
|
+
You might prefer to record across multiple trials in a study session. This can
|
|
362
|
+
be done by using trials created with the start and stop recording plugins. This
|
|
363
|
+
gives a bit of flexibility over which of the study trials are recorded.
|
|
364
|
+
|
|
365
|
+
To record a study session, create the start and stop recording trials.
|
|
366
|
+
|
|
367
|
+
```javascript
|
|
368
|
+
const startRec = { type: chsRecord.StartRecordPlugin };
|
|
369
|
+
const stopRec = { type: chsRecord.StopRecordPlugin };
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Next, create the trials that you would like to be recorded.
|
|
373
|
+
|
|
374
|
+
```javascript
|
|
375
|
+
const morning = { type: jsPsychHtmlKeyboardResponse, stimulus: "Good morning!" };
|
|
376
|
+
const evening = { type: jsPsychHtmlKeyboardResponse stimulus: "Good evening!" };
|
|
377
|
+
const night = { type: jsPsychHtmlKeyboardResponse, stimulus: "Good night!" };
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Lastly, add these trials to the timeline. Again, the video configuration trial
|
|
381
|
+
must come before any other recording trials.
|
|
382
|
+
|
|
383
|
+
```javascript
|
|
384
|
+
jsPsych.run([videoConfig, startRec, morning, evening, night, stopRec]);
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
It's possible to record only some of the trials. This can be done by moving the
|
|
388
|
+
stop or start recording trials within the timeline.
|
|
389
|
+
|
|
390
|
+
```javascript
|
|
391
|
+
jsPsych.run([videoConfig, startRec, morning, evening, stopRec, night]);
|
|
392
|
+
```
|