@vapi-ai/web 1.0.122 → 1.0.123
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/AtomicMediaSource.ts +16 -8
- package/dist/AtomicMediaSource.js +2 -2
- package/package.json +1 -1
package/AtomicMediaSource.ts
CHANGED
|
@@ -25,11 +25,15 @@ class AtomicMediaSource {
|
|
|
25
25
|
|
|
26
26
|
return new Promise((resolve, reject) => {
|
|
27
27
|
if (this.sourceBuffer) {
|
|
28
|
-
this.sourceBuffer.addEventListener(
|
|
29
|
-
|
|
28
|
+
this.sourceBuffer.addEventListener(
|
|
29
|
+
"updateend",
|
|
30
|
+
() => {
|
|
31
|
+
console.log("APPEND OP END");
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
resolve();
|
|
34
|
+
},
|
|
35
|
+
{ once: true }
|
|
36
|
+
);
|
|
33
37
|
this.sourceBuffer.appendBuffer(buffer);
|
|
34
38
|
} else {
|
|
35
39
|
reject();
|
|
@@ -45,10 +49,14 @@ class AtomicMediaSource {
|
|
|
45
49
|
|
|
46
50
|
return new Promise((resolve, reject) => {
|
|
47
51
|
if (this.sourceBuffer) {
|
|
48
|
-
this.sourceBuffer.addEventListener(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
this.sourceBuffer.addEventListener(
|
|
53
|
+
"updateend",
|
|
54
|
+
() => {
|
|
55
|
+
console.log("CLEAR OP END");
|
|
56
|
+
resolve();
|
|
57
|
+
},
|
|
58
|
+
{ once: true }
|
|
59
|
+
);
|
|
52
60
|
this.sourceBuffer.remove(0, this.mediaSource.duration);
|
|
53
61
|
} else {
|
|
54
62
|
reject();
|
|
@@ -24,7 +24,7 @@ class AtomicMediaSource {
|
|
|
24
24
|
this.sourceBuffer.addEventListener("updateend", () => {
|
|
25
25
|
console.log("APPEND OP END");
|
|
26
26
|
resolve();
|
|
27
|
-
});
|
|
27
|
+
}, { once: true });
|
|
28
28
|
this.sourceBuffer.appendBuffer(buffer);
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
@@ -42,7 +42,7 @@ class AtomicMediaSource {
|
|
|
42
42
|
this.sourceBuffer.addEventListener("updateend", () => {
|
|
43
43
|
console.log("CLEAR OP END");
|
|
44
44
|
resolve();
|
|
45
|
-
});
|
|
45
|
+
}, { once: true });
|
|
46
46
|
this.sourceBuffer.remove(0, this.mediaSource.duration);
|
|
47
47
|
}
|
|
48
48
|
else {
|