@clockworkdog/cogs-client 1.5.2 → 1.5.3
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 +0 -8
- package/dist/AudioPlayer.js +4 -3
- package/dist/browser/index.js +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,14 +20,6 @@ Include the script in your HTML page:
|
|
|
20
20
|
|
|
21
21
|
### NPM / Yarn
|
|
22
22
|
|
|
23
|
-
If you haven't yet created a web project we recommend using Vite with Typescript:
|
|
24
|
-
|
|
25
|
-
```shell
|
|
26
|
-
yarn create vite my-custom-content --template vanilla-ts
|
|
27
|
-
cd my-custom-content
|
|
28
|
-
yarn
|
|
29
|
-
```
|
|
30
|
-
|
|
31
23
|
Then add `cogs-client` with NPM or Yarn:
|
|
32
24
|
|
|
33
25
|
```shell
|
package/dist/AudioPlayer.js
CHANGED
|
@@ -133,12 +133,13 @@ class AudioPlayer {
|
|
|
133
133
|
// Once clip starts, check if it should actually be paused or stopped
|
|
134
134
|
// If not, then update state to 'playing'
|
|
135
135
|
clipPlayer.player.once('play', () => {
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
var _a;
|
|
137
|
+
const clipState = (_a = clipPlayer.activeClips[soundId]) === null || _a === void 0 ? void 0 : _a.state;
|
|
138
|
+
if ((clipState === null || clipState === void 0 ? void 0 : clipState.type) === 'pause_requested') {
|
|
138
139
|
log('Clip started playing but should be paused', { path, soundId });
|
|
139
140
|
this.pauseAudioClip(path, { fade: clipState.fade }, soundId, true);
|
|
140
141
|
}
|
|
141
|
-
else if (clipState.type === 'stop_requested') {
|
|
142
|
+
else if ((clipState === null || clipState === void 0 ? void 0 : clipState.type) === 'stop_requested') {
|
|
142
143
|
log('Clip started playing but should be stopped', { path, soundId });
|
|
143
144
|
this.stopAudioClip(path, { fade: clipState.fade }, soundId, true);
|
|
144
145
|
}
|