@vapi-ai/web 1.0.86 → 1.0.88
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.d.ts +1 -1
- package/dist/player.js +8 -14
- package/package.json +1 -1
- package/player.ts +9 -4
package/dist/player.d.ts
CHANGED
package/dist/player.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -54,6 +45,7 @@ class ContinuousPlayer extends events_1.default {
|
|
|
54
45
|
});
|
|
55
46
|
}
|
|
56
47
|
appendNextChunk(chunk) {
|
|
48
|
+
console.log("appendNextChunk");
|
|
57
49
|
return this.performBufferOperation(() => {
|
|
58
50
|
if (!this.sourceBuffer)
|
|
59
51
|
return;
|
|
@@ -61,6 +53,7 @@ class ContinuousPlayer extends events_1.default {
|
|
|
61
53
|
});
|
|
62
54
|
}
|
|
63
55
|
removeBuffer() {
|
|
56
|
+
console.log("removeBuffer");
|
|
64
57
|
return this.performBufferOperation(() => {
|
|
65
58
|
if (!this.sourceBuffer)
|
|
66
59
|
return;
|
|
@@ -70,6 +63,7 @@ class ContinuousPlayer extends events_1.default {
|
|
|
70
63
|
});
|
|
71
64
|
}
|
|
72
65
|
resetTimestampOffset() {
|
|
66
|
+
console.log("resetTimestampOffset");
|
|
73
67
|
return this.performBufferOperation(() => {
|
|
74
68
|
if (!this.sourceBuffer)
|
|
75
69
|
return;
|
|
@@ -77,6 +71,7 @@ class ContinuousPlayer extends events_1.default {
|
|
|
77
71
|
});
|
|
78
72
|
}
|
|
79
73
|
abortBuffer() {
|
|
74
|
+
console.log("abortBuffer");
|
|
80
75
|
return this.performBufferOperation(() => {
|
|
81
76
|
if (!this.sourceBuffer)
|
|
82
77
|
return;
|
|
@@ -84,11 +79,10 @@ class ContinuousPlayer extends events_1.default {
|
|
|
84
79
|
});
|
|
85
80
|
}
|
|
86
81
|
clear() {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
});
|
|
82
|
+
console.log("oyoiyo");
|
|
83
|
+
this.operationsQueue.push(() => this.abortBuffer());
|
|
84
|
+
this.operationsQueue.push(() => this.removeBuffer());
|
|
85
|
+
this.operationsQueue.push(() => this.resetTimestampOffset());
|
|
92
86
|
}
|
|
93
87
|
}
|
|
94
88
|
exports.ContinuousPlayer = ContinuousPlayer;
|
package/package.json
CHANGED
package/player.ts
CHANGED
|
@@ -59,6 +59,7 @@ export class ContinuousPlayer extends EventEmitter {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
private appendNextChunk(chunk: ArrayBuffer) {
|
|
62
|
+
console.log("appendNextChunk");
|
|
62
63
|
return this.performBufferOperation(() => {
|
|
63
64
|
if (!this.sourceBuffer) return;
|
|
64
65
|
this.sourceBuffer.appendBuffer(chunk);
|
|
@@ -66,6 +67,7 @@ export class ContinuousPlayer extends EventEmitter {
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
private removeBuffer() {
|
|
70
|
+
console.log("removeBuffer");
|
|
69
71
|
return this.performBufferOperation(() => {
|
|
70
72
|
if (!this.sourceBuffer) return;
|
|
71
73
|
while (this.sourceBuffer.buffered.length > 0) {
|
|
@@ -75,6 +77,7 @@ export class ContinuousPlayer extends EventEmitter {
|
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
private resetTimestampOffset() {
|
|
80
|
+
console.log("resetTimestampOffset");
|
|
78
81
|
return this.performBufferOperation(() => {
|
|
79
82
|
if (!this.sourceBuffer) return;
|
|
80
83
|
this.sourceBuffer.timestampOffset = 0;
|
|
@@ -82,15 +85,17 @@ export class ContinuousPlayer extends EventEmitter {
|
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
private abortBuffer() {
|
|
88
|
+
console.log("abortBuffer");
|
|
85
89
|
return this.performBufferOperation(() => {
|
|
86
90
|
if (!this.sourceBuffer) return;
|
|
87
91
|
this.sourceBuffer.abort();
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
clear() {
|
|
96
|
+
console.log("oyoiyo");
|
|
97
|
+
this.operationsQueue.push(() => this.abortBuffer());
|
|
98
|
+
this.operationsQueue.push(() => this.removeBuffer());
|
|
99
|
+
this.operationsQueue.push(() => this.resetTimestampOffset());
|
|
95
100
|
}
|
|
96
101
|
}
|