@vindral/web-sdk 4.1.5-5-gfe7b461b → 4.1.5-7-gfedebb3e
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/{D0IMhaql.js → B7vIH0lF.js} +1 -1
- package/{Bdbmrcn2.js → D6A1wDaY.js} +1 -1
- package/{C7zTW_MY.js → DdOE9X7R.js} +300 -295
- package/cast-sender.d.ts +8 -0
- package/core.d.ts +8 -0
- package/core.js +1 -1
- package/legacy.d.ts +8 -0
- package/legacy.es.js +22 -17
- package/legacy.umd.js +3 -3
- package/package.json +1 -1
- package/player.d.ts +8 -0
- package/player.js +285 -284
- package/react.d.ts +8 -0
package/cast-sender.d.ts
CHANGED
|
@@ -265,6 +265,14 @@ interface Options {
|
|
|
265
265
|
* Whether to start the player muted or to try to start playing audio automatically.
|
|
266
266
|
*/
|
|
267
267
|
muted?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Initial volume level for the player. A floating point value between 0-1.
|
|
270
|
+
* Default is 1 (100% volume).
|
|
271
|
+
*
|
|
272
|
+
* Note: Volume cannot be set on iOS devices due to system restrictions.
|
|
273
|
+
* The volume property is not settable in JavaScript on iOS, and reading it always returns 1.
|
|
274
|
+
*/
|
|
275
|
+
volume?: number;
|
|
268
276
|
/**
|
|
269
277
|
* Provide a custom reconnect handler to control when the instance should stop trying to
|
|
270
278
|
* reconnect. The reconnect handler should either return true to allow the reconnect or
|
package/core.d.ts
CHANGED
|
@@ -480,6 +480,14 @@ export interface Options {
|
|
|
480
480
|
* Whether to start the player muted or to try to start playing audio automatically.
|
|
481
481
|
*/
|
|
482
482
|
muted?: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* Initial volume level for the player. A floating point value between 0-1.
|
|
485
|
+
* Default is 1 (100% volume).
|
|
486
|
+
*
|
|
487
|
+
* Note: Volume cannot be set on iOS devices due to system restrictions.
|
|
488
|
+
* The volume property is not settable in JavaScript on iOS, and reading it always returns 1.
|
|
489
|
+
*/
|
|
490
|
+
volume?: number;
|
|
483
491
|
/**
|
|
484
492
|
* Provide a custom reconnect handler to control when the instance should stop trying to
|
|
485
493
|
* reconnect. The reconnect handler should either return true to allow the reconnect or
|
package/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as C, e as I, f as _, a as O, C as D, D as T, I as a, N as A, V as s, g as r } from "./
|
|
1
|
+
import { c as C, e as I, f as _, a as O, C as D, D as T, I as a, N as A, V as s, g as r } from "./DdOE9X7R.js";
|
|
2
2
|
export {
|
|
3
3
|
C as AUTHENTICATION_EXPIRED_CODE,
|
|
4
4
|
I as AUTHENTICATION_FAILED_CODE,
|
package/legacy.d.ts
CHANGED
|
@@ -483,6 +483,14 @@ export interface Options {
|
|
|
483
483
|
* Whether to start the player muted or to try to start playing audio automatically.
|
|
484
484
|
*/
|
|
485
485
|
muted?: boolean;
|
|
486
|
+
/**
|
|
487
|
+
* Initial volume level for the player. A floating point value between 0-1.
|
|
488
|
+
* Default is 1 (100% volume).
|
|
489
|
+
*
|
|
490
|
+
* Note: Volume cannot be set on iOS devices due to system restrictions.
|
|
491
|
+
* The volume property is not settable in JavaScript on iOS, and reading it always returns 1.
|
|
492
|
+
*/
|
|
493
|
+
volume?: number;
|
|
486
494
|
/**
|
|
487
495
|
* Provide a custom reconnect handler to control when the instance should stop trying to
|
|
488
496
|
* reconnect. The reconnect handler should either return true to allow the reconnect or
|
package/legacy.es.js
CHANGED
|
@@ -1313,6 +1313,7 @@ const Fi = (i) => "width" in i && typeof i.width == "number", Gi = (i) => "sampl
|
|
|
1313
1313
|
mseEnabled: !0,
|
|
1314
1314
|
mseOpusEnabled: !0,
|
|
1315
1315
|
muted: !1,
|
|
1316
|
+
volume: 1,
|
|
1316
1317
|
minBufferTime: 1500,
|
|
1317
1318
|
maxBufferTime: 1500,
|
|
1318
1319
|
logLevel: Wr.OFF,
|
|
@@ -3595,7 +3596,7 @@ const Dd = (i) => {
|
|
|
3595
3596
|
A.vindralInstances = A.vindralInstances || {}, A.vindralInstances[i.getStatistics().clientId.substring(0, 8)] = i;
|
|
3596
3597
|
};
|
|
3597
3598
|
class zQ extends $A {
|
|
3598
|
-
constructor({ type: t, autoplay: e, muted: g,
|
|
3599
|
+
constructor({ type: t, autoplay: e, muted: g, volume: B, logger: C, poster: Q }) {
|
|
3599
3600
|
super();
|
|
3600
3601
|
I(this, "element");
|
|
3601
3602
|
I(this, "logger");
|
|
@@ -3706,11 +3707,11 @@ class zQ extends $A {
|
|
|
3706
3707
|
I(this, "onSeekEnd", () => {
|
|
3707
3708
|
this.seekStartTime && (this.seekTimes.push(Date.now() - this.seekStartTime), this.seekStartTime = void 0);
|
|
3708
3709
|
});
|
|
3709
|
-
this.logger =
|
|
3710
|
+
this.logger = C, this._userProvidedMuted = g, this.element = document.createElement(t), this.element instanceof HTMLVideoElement && (this.element.playsInline = !0), this.element.controls = !1, this.element.autoplay = e, this.element.muted = g, B !== void 0 && (this.element.volume = B), this.element.style.display = "block", this.element.style.width = "100%", this.element.disableRemotePlayback = !0, this.element.setAttribute(
|
|
3710
3711
|
"poster",
|
|
3711
3712
|
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAQAAACRI2S5AAAAEElEQVR42mNkIAAYRxWAAQAG9gAKqv6+AwAAAABJRU5ErkJggg=="
|
|
3712
3713
|
), this.onPlayPause(), setTimeout(() => {
|
|
3713
|
-
!this.element || !
|
|
3714
|
+
!this.element || !Q || this.element.setAttribute("poster", Q);
|
|
3714
3715
|
}, 0), this.element.addEventListener("stalled", this.onEvent), this.element.addEventListener("canplay", this.onEvent), this.element.addEventListener("loadeddata", this.onEvent), this.element.addEventListener("loadedmetadata", this.onEvent), this.element.addEventListener("canplaythrough", this.onEvent), this.element.addEventListener("waiting", this.onEvent), this.element.addEventListener("playing", this.onPlayPause), this.element.addEventListener("pause", this.onPlayPause), this.element.addEventListener("seeked", this.onSeekEnd), this.element.addEventListener("seeking", this.onSeekStart), this.element.addEventListener("volumechange", this.onVolumeChange), this.element.addEventListener("timeupdate", this.onBufferStateChange), this.element.addEventListener("progress", this.onBufferStateChange);
|
|
3715
3716
|
}
|
|
3716
3717
|
get seekTime() {
|
|
@@ -9631,7 +9632,7 @@ class du {
|
|
|
9631
9632
|
}
|
|
9632
9633
|
}
|
|
9633
9634
|
const PC = class PC {
|
|
9634
|
-
constructor(A, t, e, g, B) {
|
|
9635
|
+
constructor(A, t, e, g, B, C) {
|
|
9635
9636
|
I(this, "logger");
|
|
9636
9637
|
I(this, "emitter");
|
|
9637
9638
|
I(this, "audioPlayer");
|
|
@@ -9682,7 +9683,7 @@ const PC = class PC {
|
|
|
9682
9683
|
this.logger = t, this.emitter = A, this.pool = e, this.audioPlayer = iC.create(this.logger.createContext("AudioPlayerModule"), g, {
|
|
9683
9684
|
muted: B,
|
|
9684
9685
|
reInitWhenStuck: !0
|
|
9685
|
-
}), this.audioPlayer.on("stuck", () => {
|
|
9686
|
+
}), C !== void 0 && (this.audioPlayer.volume = C), this.audioPlayer.on("stuck", () => {
|
|
9686
9687
|
this.isDisconnected = !0;
|
|
9687
9688
|
}), this.audioPlayer.on("state change", () => {
|
|
9688
9689
|
this.emitter.emit("volume state", {
|
|
@@ -9742,10 +9743,10 @@ const PC = class PC {
|
|
|
9742
9743
|
this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
|
|
9743
9744
|
}
|
|
9744
9745
|
};
|
|
9745
|
-
I(PC, "create", (A, t, e, g, B) => new PC(A, t, e, g, B));
|
|
9746
|
+
I(PC, "create", (A, t, e, g, B, C) => new PC(A, t, e, g, B, C));
|
|
9746
9747
|
let Fo = PC;
|
|
9747
9748
|
const xC = class xC {
|
|
9748
|
-
constructor(A, t, e, g, { muted: B,
|
|
9749
|
+
constructor(A, t, e, g, { muted: B, volume: C, type: Q, poster: o }) {
|
|
9749
9750
|
I(this, "logger");
|
|
9750
9751
|
I(this, "emitter");
|
|
9751
9752
|
I(this, "mediaElement");
|
|
@@ -9814,23 +9815,24 @@ const xC = class xC {
|
|
|
9814
9815
|
Li(A, this.volumeState) || (this.volumeState = A, this.emitter.emit("volume state", this.volumeState));
|
|
9815
9816
|
});
|
|
9816
9817
|
this.logger = t, this.emitter = A, this.pool = e, this._userProvidedMuted = B, this.mediaElement = new zQ({
|
|
9817
|
-
poster:
|
|
9818
|
-
type:
|
|
9818
|
+
poster: o,
|
|
9819
|
+
type: Q,
|
|
9819
9820
|
muted: B,
|
|
9821
|
+
volume: C,
|
|
9820
9822
|
autoplay: !1,
|
|
9821
9823
|
logger: this.logger.createContext("MediaElement")
|
|
9822
|
-
}), this.mediaElement.on("volume state", (
|
|
9823
|
-
this.updateVolumeState(), !
|
|
9824
|
-
}), this.mediaElement.on("media element state", (
|
|
9825
|
-
|
|
9824
|
+
}), this.mediaElement.on("volume state", (a) => {
|
|
9825
|
+
this.updateVolumeState(), !a.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(H), a.isMuted || (this._userProvidedMuted = !1);
|
|
9826
|
+
}), this.mediaElement.on("media element state", (a) => {
|
|
9827
|
+
a === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", a);
|
|
9826
9828
|
}), this.audioPlayer = iC.create(this.logger.createContext("AudioPlayerModule"), g, {
|
|
9827
9829
|
muted: !1,
|
|
9828
9830
|
// Never muted because its the media element that limits audio output,
|
|
9829
9831
|
reInitWhenStuck: !1
|
|
9830
9832
|
}), this.audioPlayer.on("stuck", () => {
|
|
9831
9833
|
this.isDisconnected = !0;
|
|
9832
|
-
}), this.audioPlayer.on("state change", (
|
|
9833
|
-
|
|
9834
|
+
}), this.audioPlayer.on("state change", (a) => {
|
|
9835
|
+
a === "suspended" || a === "interrupted" ? this.mediaElement.muted = !0 : a === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
|
|
9834
9836
|
}), this.videoPlayer = IC.create(
|
|
9835
9837
|
this.logger.createContext("VideoPlayerModule"),
|
|
9836
9838
|
this.audioPlayer,
|
|
@@ -11726,7 +11728,7 @@ const Mt = class Mt extends $A {
|
|
|
11726
11728
|
const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
|
|
11727
11729
|
return D({
|
|
11728
11730
|
uptime: Date.now() - this.createdAt,
|
|
11729
|
-
version: "4.1.5-
|
|
11731
|
+
version: "4.1.5-7-gfedebb3e",
|
|
11730
11732
|
clientId: this.clientId,
|
|
11731
11733
|
sessionId: this.sessionId,
|
|
11732
11734
|
channelId: this.channelId,
|
|
@@ -11814,6 +11816,7 @@ const Mt = class Mt extends $A {
|
|
|
11814
11816
|
type: this.options.get("media") == "audio" ? "audio" : "video",
|
|
11815
11817
|
autoplay: !1,
|
|
11816
11818
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
11819
|
+
volume: this.options.get("volume"),
|
|
11817
11820
|
logger: this.logger.createContext("MediaElement"),
|
|
11818
11821
|
poster: S
|
|
11819
11822
|
});
|
|
@@ -11827,6 +11830,7 @@ const Mt = class Mt extends $A {
|
|
|
11827
11830
|
{
|
|
11828
11831
|
type: this.options.get("media") == "audio" ? "audio" : "video",
|
|
11829
11832
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
11833
|
+
volume: this.options.get("volume"),
|
|
11830
11834
|
poster: S
|
|
11831
11835
|
}
|
|
11832
11836
|
), f = w.element();
|
|
@@ -11837,7 +11841,8 @@ const Mt = class Mt extends $A {
|
|
|
11837
11841
|
this.logger.createContext("LegacyCanvasModule"),
|
|
11838
11842
|
this.pool,
|
|
11839
11843
|
this,
|
|
11840
|
-
this.options.get("muted") || this.options.get("media") === "video"
|
|
11844
|
+
this.options.get("muted") || this.options.get("media") === "video",
|
|
11845
|
+
this.options.get("volume")
|
|
11841
11846
|
);
|
|
11842
11847
|
this.element = w.element(), this.playbackSource = w, y = w, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new ud());
|
|
11843
11848
|
}
|