mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 03:00:54 +00:00
fix wording and some links
This commit is contained in:
parent
2f859b8887
commit
f4ba84a3a7
@ -168,7 +168,7 @@ The `version` field describes the version of the extension used and then durin t
|
||||
|
||||
The `data` field is an object containing all of the `data` generated for the plugin. Each 'data' object has a `type` and `default` property. Additionally, this should be only used for data you choose to generate. Any jsdoc (comments included in the /** */ tags) you include will be scraped as metadata if you are choosing to generate metadata. This scraped metadata will also be used to create the JsPsych documentation.
|
||||
|
||||
For more information on the various types of parameters one can include in their data field, see [here](./plugin-development.md#parameter-types).
|
||||
For more information on the various types of parameters one can include in their data field, see our [documentation on `ParameterType`s](./plugin-development.md#parameter-types).
|
||||
|
||||
### Optional methods
|
||||
|
||||
|
@ -61,9 +61,9 @@ const info = {
|
||||
}
|
||||
```
|
||||
|
||||
??? info "Custom Build Environments"
|
||||
??? info "Automatic versioning with custom build environments"
|
||||
|
||||
If you are using a custom build environment that imports its own `tsconfig.json` file that does not extend jsPsych's, but you want to use this syntax, you must add `"resolveJsonModule": true` to the config's `compilerOptions` object.
|
||||
If you are using a custom build environment that imports its own `tsconfig.json` file that does not extend jsPsych's, and you want to use this automatic versioning syntax, you must add `"resolveJsonModule": true` to the config's `compilerOptions` object.
|
||||
|
||||
If you are not using a build environment that supports `import` and `package.json` (such as writing a plain JS file), you can manually enter the `version` as a string.
|
||||
|
||||
@ -169,7 +169,7 @@ MyAwesomePlugin.info = info;
|
||||
|
||||
#### Parameter Types
|
||||
|
||||
jsPsych currently has support for the following parameters:
|
||||
jsPsych currently has support for the following parameter types:
|
||||
|
||||
| Type Name | Description | Example |
|
||||
| --------- | ----------- | ------- |
|
||||
|
@ -298,7 +298,7 @@ Returns nothing.
|
||||
|
||||
#### Description
|
||||
|
||||
Method that belongs to the AudioPlayer class. Stops the audio loaded into the audio buffer of the AudioPlayer instance for a particular file. If the audio is an HTML5 audio object it pauses it. If the audio is a Webaudio API object it stops it. This will regenerate the audio player, allowing you to call the `play()` method upon it again.
|
||||
Method that belongs to the AudioPlayer class. Stops the audio loaded into the audio buffer of the AudioPlayer instance for a particular file. If the audio is an HTML5 audio object it pauses it. If the audio is a WebAudio API object it stops it. This will regenerate the audio player, allowing you to call the `play()` method upon it again.
|
||||
|
||||
#### Example
|
||||
|
||||
|
@ -86,9 +86,6 @@ const trial = {
|
||||
The `button_html` parameter can also support different HTML for each button.
|
||||
See the [plugin documentation](https://www.jspsych.org/latest/plugins/html-button-response/index.html) for more details.
|
||||
|
||||
For plugin developers: if you are writing a plugin and updating parameters to use functions,
|
||||
make sure to mock these functions in Jest to ensure tests can still run.
|
||||
|
||||
## Plugin parameter handling
|
||||
|
||||
In version 7.x, a plugin could omit parameters from the `info` object and jsPsych would still evaluate these parameters appropriately in most cases.
|
||||
@ -113,7 +110,7 @@ In version 9.x, we plan to make this a requirement.
|
||||
In version 7.x, jsPsych's `pluginAPI` class exposed WebAudio and HTML5 audio APIs through `getAudioBuffer()`. However, this required different implementations done by the developer to account for each API.
|
||||
In version 8.x, we've removed this in favor of `getAudioPlayer()`, which handles both API choices under the hood.
|
||||
|
||||
This change only effects plugin developers. If you want to update to use the new `getAudioPlayer()`, it is recommend that you call this new method using the `await` syntax, which requires an asynchronous `trial` function:
|
||||
This change only affects plugin developers. If you want to update to use the new `getAudioPlayer()`, it is recommend that you call this new method using the `await` syntax, which requires an asynchronous `trial` function:
|
||||
```js
|
||||
const audio = await jsPsych.pluginAPI.getAudioPlayer('my-sound.mp3');
|
||||
```
|
||||
@ -148,7 +145,7 @@ Along with this, the `start()` and `pause()` functions were removed from the `Au
|
||||
You can still call `stop()` upon an audio ending in order to regenerate the `AudioPlayer`, and be able
|
||||
to call `play()` on it again.
|
||||
|
||||
For a general guide on implementation, the `audio-button-response` plugin uses the `await` syntax
|
||||
For a general guide on implementation, the [`audio-button-response`](https://github.com/jspsych/jsPsych/blob/main/packages/plugin-audio-button-response/src/index.ts) plugin uses the `await` syntax
|
||||
to handle playing audio.
|
||||
|
||||
## Changes to `finishTrial()`
|
||||
|
Loading…
Reference in New Issue
Block a user