@vapi-ai/web 1.0.32 → 1.0.33
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/dist/player.js +3 -2
- package/package.json +1 -1
- package/player.ts +5 -2
package/dist/player.js
CHANGED
|
@@ -30,14 +30,15 @@ class ContinuousPlayer extends events_1.default {
|
|
|
30
30
|
}
|
|
31
31
|
appendNextChunk() {
|
|
32
32
|
var _a;
|
|
33
|
-
console.log(
|
|
33
|
+
console.log(`Current playing status: ${this.audio.paused ? "Paused" : "Playing"}`);
|
|
34
|
+
console.log(`Buffered status: ${(_a = this.sourceBuffer) === null || _a === void 0 ? void 0 : _a.buffered}`);
|
|
35
|
+
console.log(`MediaSource readyState: ${this.mediaSource.readyState}`);
|
|
34
36
|
if (this.sourceBuffer &&
|
|
35
37
|
!this.sourceBuffer.updating &&
|
|
36
38
|
this.audioQueue.length > 0) {
|
|
37
39
|
const chunk = this.audioQueue.shift();
|
|
38
40
|
if (chunk) {
|
|
39
41
|
this.sourceBuffer.appendBuffer(chunk);
|
|
40
|
-
this.audio.play();
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
}
|
package/package.json
CHANGED
package/player.ts
CHANGED
|
@@ -36,7 +36,11 @@ export class ContinuousPlayer extends EventEmitter {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
private appendNextChunk(): void {
|
|
39
|
-
console.log(
|
|
39
|
+
console.log(
|
|
40
|
+
`Current playing status: ${this.audio.paused ? "Paused" : "Playing"}`
|
|
41
|
+
);
|
|
42
|
+
console.log(`Buffered status: ${this.sourceBuffer?.buffered}`);
|
|
43
|
+
console.log(`MediaSource readyState: ${this.mediaSource.readyState}`);
|
|
40
44
|
if (
|
|
41
45
|
this.sourceBuffer &&
|
|
42
46
|
!this.sourceBuffer.updating &&
|
|
@@ -45,7 +49,6 @@ export class ContinuousPlayer extends EventEmitter {
|
|
|
45
49
|
const chunk = this.audioQueue.shift();
|
|
46
50
|
if (chunk) {
|
|
47
51
|
this.sourceBuffer.appendBuffer(chunk);
|
|
48
|
-
this.audio.play();
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
54
|
}
|