clicktone 1.5.0 → 1.5.2
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 +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ import ClickTone from 'clicktone';
|
|
|
31
31
|
|
|
32
32
|
➤ **Usage**
|
|
33
33
|
|
|
34
|
-
<sub>
|
|
34
|
+
<sub>ClickTone uses the Web Audio API, which supports many audio file formats: MP3, WAV, OGG, AAC and others. Note that not all browsers support these formats.</sub>
|
|
35
35
|
```javascript
|
|
36
36
|
const click = new ClickTone({
|
|
37
37
|
file: './sound.mp3',
|
|
@@ -45,6 +45,17 @@ myButton.addEventListener('click', () => click.play());
|
|
|
45
45
|
```
|
|
46
46
|
<br>
|
|
47
47
|
|
|
48
|
+
➤ **Options**
|
|
49
|
+
|
|
50
|
+
| Option | Type | Default | Description |
|
|
51
|
+
|:----------:|:-----------------------------------:|:--------:|:---------------------------------------------------------------------------------------------|
|
|
52
|
+
| `file` | `string` | `none` | The URL of the audio file to be played. |
|
|
53
|
+
| `volume` | `number` | `1.0` | Volume level for the audio playback, ranging from 0.0 (mute) to 1.0 (full volume). |
|
|
54
|
+
| `callback` | `((error?: Error) => void) \| null` | `null` | A callback function to be executed after the audio finishes playing, or if an error occurs. |
|
|
55
|
+
| `throttle` | `number` | `0` | Minimum time (in milliseconds) between successive audio plays to prevent rapid repeat plays. |
|
|
56
|
+
| `debug` | `boolean` | `false` | If `true`, debug information and errors will be logged to the console. |
|
|
57
|
+
<br>
|
|
58
|
+
|
|
48
59
|
➤ **License**
|
|
49
60
|
|
|
50
61
|
clicktone is released under MIT license.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clicktone",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "ClickTone is designed to control audio playback with various settings, including volume control, callback and debug mode. It also includes iOS support.",
|
|
5
5
|
"author": "ux-ui.pro",
|
|
6
6
|
"license": "MIT",
|