@vindral/web-sdk 3.2.3 → 3.2.4

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/index.mjs CHANGED
@@ -1380,6 +1380,19 @@ class Qg extends iA {
1380
1380
  t(this, "isClosed", () => this.mediaSource.readyState === "closed");
1381
1381
  t(this, "isEnded", () => this.mediaSource.readyState === "ended");
1382
1382
  t(this, "createObjectURL", () => URL.createObjectURL(this.mediaSource));
1383
+ t(this, "attach", (e) => {
1384
+ const g = e;
1385
+ if ("srcObject" in g)
1386
+ try {
1387
+ g.srcObject = this.mediaSource;
1388
+ } catch (s) {
1389
+ if (s instanceof Error && s.name !== "TypeError")
1390
+ throw s;
1391
+ g.src = this.createObjectURL();
1392
+ }
1393
+ else
1394
+ e.src = this.createObjectURL();
1395
+ });
1383
1396
  t(this, "addSourceBuffer", (e) => {
1384
1397
  const g = this.mediaSource.addSourceBuffer(e);
1385
1398
  return new hI(g);
@@ -4157,7 +4170,7 @@ const re = class re {
4157
4170
  const s = !this.mediaElement.paused, I = [];
4158
4171
  this.trackContexts.forEach((B, n) => {
4159
4172
  B.state === "initialized" && I.push({ type: n, mimeType: B.mimeType });
4160
- }), this.sourceOpenStartTime = Date.now(), this.pendingTracksToAddSourceBuffers = I, this.mediaElement.src = "", this.setTrackContexts(this.trackContexts), this.mediaElement.src = this.mediaSource.createObjectURL(), s && this.mediaElement.play();
4173
+ }), this.sourceOpenStartTime = Date.now(), this.pendingTracksToAddSourceBuffers = I, this.mediaElement.src = "", this.setTrackContexts(this.trackContexts), this.mediaSource.attach(this.mediaElement), s && this.mediaElement.play();
4161
4174
  }
4162
4175
  }
4163
4176
  this.logger.debug("source ended");
@@ -4167,7 +4180,7 @@ const re = class re {
4167
4180
  };
4168
4181
  t(re, "create", (A, e, g) => {
4169
4182
  const s = new re(A, e, g);
4170
- return s.setTrackContexts(), s.mediaSource.on("source ended", s.onSourceEnded), s.mediaSource.on("source open", s.onSourceOpen), g.src = s.mediaSource.createObjectURL(), s;
4183
+ return s.setTrackContexts(), s.mediaSource.on("source ended", s.onSourceEnded), s.mediaSource.on("source open", s.onSourceOpen), s.mediaSource.attach(g), s;
4171
4184
  });
4172
4185
  let rt = re;
4173
4186
  const ti = (i, A) => {
@@ -5537,7 +5550,7 @@ const bB = (i) => {
5537
5550
  const e = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
5538
5551
  return h({
5539
5552
  uptime: Date.now() - this.createdAt,
5540
- version: "3.2.3",
5553
+ version: "3.2.4",
5541
5554
  clientId: this.clientId,
5542
5555
  sessionId: this.sessionId,
5543
5556
  channelId: this.channelId,