@vindral/web-sdk 4.7.1 → 4.7.2-10-gd9156e94

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/README.md CHANGED
@@ -78,10 +78,10 @@ Or use vindral-player-component.js is a self-registering variant of the web comp
78
78
  <script type="module" async src="https://cdn.jsdelivr.net/npm/@vindral/web-sdk/vindral-player-component.js"></script>
79
79
  ```
80
80
 
81
- Channel id is the only required attribute when using `<vindral-player />`.
81
+ `channel-id` is the only required attribute when using `<vindral-player />`.
82
82
 
83
83
  ```html
84
- <vindral-player channelId="vindral_demo1_ci_099ee1fa-80f3-455e-aa23-3d184e93e04f"></vindral-player>
84
+ <vindral-player channel-id="vindral_demo1_ci_099ee1fa-80f3-455e-aa23-3d184e93e04f"></vindral-player>
85
85
  ```
86
86
 
87
87
  Easy to customize controls with CSS variables.
@@ -1,7 +1,7 @@
1
1
  import { n as e, t } from "./BsfwXDui.js";
2
2
  import { i as n, n as r, r as i, t as a } from "./DSw1XhvD.js";
3
3
  import { t as o } from "./D1kpe8tT.js";
4
- import { C as s, S as c, b as l, i as u, r as ee, t as d, y as f } from "./BK-84KPi.js";
4
+ import { C as s, S as c, b as l, i as u, r as ee, t as d, y as f } from "./CoLAnqGB.js";
5
5
  import { t as p } from "./Tj9xPXja.js";
6
6
  //#region \0rolldown/runtime.js
7
7
  var m = Object.defineProperty, h = (e, t) => {
package/cast-sender.d.ts CHANGED
@@ -317,6 +317,17 @@ interface Options {
317
317
  logShippingEnabled?: boolean;
318
318
  statsShippingEnabled?: boolean;
319
319
  webtransportEnabled?: boolean;
320
+ /**
321
+ * Use WebTransport for MoQ on browsers where it is unstable. When false, these connect MoQ over
322
+ * WebSocket directly. Unstable browsers:
323
+ * - Safari and every iOS/iPadOS browser (all WebKit): far more buffering than over WebSocket.
324
+ * - Samsung Internet on Tizen Smart TVs: WebTransport connects fail and fall back to WebSocket.
325
+ *
326
+ * Has no effect when webtransportEnabled is false.
327
+ *
328
+ * Default is false.
329
+ */
330
+ unstableWebtransportEnabled?: boolean;
320
331
  /**
321
332
  * Enable wake lock for iOS devices.
322
333
  * The wake lock requires that the audio has been activated at least once for the instance, othwerwise it will not work.
package/core.d.ts CHANGED
@@ -422,6 +422,17 @@ export interface Options {
422
422
  logShippingEnabled?: boolean;
423
423
  statsShippingEnabled?: boolean;
424
424
  webtransportEnabled?: boolean;
425
+ /**
426
+ * Use WebTransport for MoQ on browsers where it is unstable. When false, these connect MoQ over
427
+ * WebSocket directly. Unstable browsers:
428
+ * - Safari and every iOS/iPadOS browser (all WebKit): far more buffering than over WebSocket.
429
+ * - Samsung Internet on Tizen Smart TVs: WebTransport connects fail and fall back to WebSocket.
430
+ *
431
+ * Has no effect when webtransportEnabled is false.
432
+ *
433
+ * Default is false.
434
+ */
435
+ unstableWebtransportEnabled?: boolean;
425
436
  /**
426
437
  * Enable wake lock for iOS devices.
427
438
  * The wake lock requires that the audio has been activated at least once for the instance, othwerwise it will not work.
@@ -819,7 +830,7 @@ declare class ApiClient {
819
830
  private toChannels;
820
831
  private toChannel;
821
832
  }
822
- type TransportSelectionReason = "unsupported" | "disabled" | "unavailable" | "fallback";
833
+ type TransportSelectionReason = "unsupported" | "disabled" | "disabled_unstable_browser" | "unavailable" | "fallback";
823
834
  interface AdaptivityStatistics {
824
835
  /**
825
836
  * True if adaptive bitrate (ABR) is enabled.
@@ -1158,11 +1169,10 @@ export type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["get
1158
1169
  /**
1159
1170
  * Represents a Vindral client instance
1160
1171
  *
1161
- * The most most essential methods when using the Vindral class are:
1172
+ * The most essential methods when using the Vindral class are:
1162
1173
  *
1163
- * - connect() - this has to be called to actually start connecting
1174
+ * - play() - connects and starts playing; call it from a user gesture to activate audio on browsers that require one
1164
1175
  * - attach() - to attach the Vindral video view to the DOM so that users can see it
1165
- * - userInput() - to activate audio on browsers that require a user gesture to play audio
1166
1176
  * - unload() - unloads the instance, its very important that this is called when cleaning up the Vindral instance, otherwise background timers may leak.
1167
1177
  *
1168
1178
  * The Vindral instance will emit a variety of events during its lifetime. Use .on("event-name", callback) to listen to these events.
@@ -1181,8 +1191,8 @@ export type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["get
1181
1191
  * // Will be called when a user interaction is needed to activate audio
1182
1192
  * instance.on("needs user input", console.log)
1183
1193
  *
1184
- * // Start connecting to the cdn
1185
- * instance.connect()
1194
+ * // Start connecting to the cdn and playing
1195
+ * instance.play()
1186
1196
  *
1187
1197
  * // Attach the video view to the DOM
1188
1198
  * instance.attach(document.getElementById("root"))
@@ -1554,6 +1564,11 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1554
1564
  */
1555
1565
  getCastOptions: () => Options;
1556
1566
  private onConnectInfo;
1567
+ /**
1568
+ * The connection closed because media queued ahead of the pong for seconds, so the current level doesn't fit the
1569
+ * link. Lower the target below it before the rejoin, which otherwise asks for the same quality again.
1570
+ */
1571
+ private stepDownForRejoin;
1557
1572
  private emitLanguagesIfChanged;
1558
1573
  private updateTextTracks;
1559
1574
  private cleanupTextTracks;
@@ -1752,6 +1767,7 @@ interface ConnectionStatistics {
1752
1767
  * When connectionProtocol is "moq_ws", indicates why WebSocket was used instead of WebTransport.
1753
1768
  * - "unsupported": browser doesn't support WebTransport
1754
1769
  * - "disabled": webtransportEnabled option is false
1770
+ * - "disabled_unstable_browser": browser with unstable WebTransport, and unstableWebtransportEnabled option is false
1755
1771
  * - "unavailable": edge did not offer a WebTransport endpoint
1756
1772
  * - "fallback": WebTransport was attempted but failed or timed out
1757
1773
  * Unset while reconnecting; once disconnected, the last connection's.
@@ -1772,7 +1788,7 @@ export interface LanguageSwitchContext {
1772
1788
  */
1773
1789
  export interface ChannelSwitchContext {
1774
1790
  /**
1775
- * The new channel id that was switched to
1791
+ * The new channel on "channel switch", the current channel on "channel switch failed"
1776
1792
  */
1777
1793
  channelId: string;
1778
1794
  }
@@ -1880,12 +1896,12 @@ export interface PublicVindralEvents {
1880
1896
  "is live": boolean;
1881
1897
  /**
1882
1898
  * Emitted when a channel switch has been completed and the first frame of the new channel is rendered.
1883
- * A string containing the channel id of the new channel is provided as an argument.
1899
+ * The argument holds the channel id of the new channel.
1884
1900
  */
1885
1901
  "channel switch": Readonly<ChannelSwitchContext>;
1886
1902
  /**
1887
- * Emmitted when a channel switch fails.
1888
- * A string containing the channel id of the current channel is provided as an argument.
1903
+ * Emitted when a channel switch fails.
1904
+ * The argument holds the channel id of the current channel.
1889
1905
  */
1890
1906
  "channel switch failed": Readonly<ChannelSwitchContext>;
1891
1907
  /**
package/core.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, o, r as s, s as c, t as l, u } from "./BZbYOX-0.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, o, r as s, s as c, t as l, u } from "./DjRUgOvD.js";
2
2
  export { s as AUTHENTICATION_EXPIRED_CODE, i as AUTHENTICATION_FAILED_CODE, e as CHANNEL_NOT_FOUND_CODE, o as CHANNEL_NOT_LIVE_CODE, c as CONNECTION_FAILED_AFTER_RETRIES_CODE, t as CONNECTION_FAILED_CODE, a as DISCONNECTED_BY_EDGE, u as INACTIVITY_CODE, n as NO_INCOMING_DATA, l as Vindral, r as VindralError };
package/legacy.d.ts CHANGED
@@ -425,6 +425,17 @@ export interface Options {
425
425
  logShippingEnabled?: boolean;
426
426
  statsShippingEnabled?: boolean;
427
427
  webtransportEnabled?: boolean;
428
+ /**
429
+ * Use WebTransport for MoQ on browsers where it is unstable. When false, these connect MoQ over
430
+ * WebSocket directly. Unstable browsers:
431
+ * - Safari and every iOS/iPadOS browser (all WebKit): far more buffering than over WebSocket.
432
+ * - Samsung Internet on Tizen Smart TVs: WebTransport connects fail and fall back to WebSocket.
433
+ *
434
+ * Has no effect when webtransportEnabled is false.
435
+ *
436
+ * Default is false.
437
+ */
438
+ unstableWebtransportEnabled?: boolean;
428
439
  /**
429
440
  * Enable wake lock for iOS devices.
430
441
  * The wake lock requires that the audio has been activated at least once for the instance, othwerwise it will not work.
@@ -834,7 +845,7 @@ export declare class ApiClient {
834
845
  private toChannels;
835
846
  private toChannel;
836
847
  }
837
- type TransportSelectionReason = "unsupported" | "disabled" | "unavailable" | "fallback";
848
+ type TransportSelectionReason = "unsupported" | "disabled" | "disabled_unstable_browser" | "unavailable" | "fallback";
838
849
  interface AdaptivityStatistics {
839
850
  /**
840
851
  * True if adaptive bitrate (ABR) is enabled.
@@ -1173,11 +1184,10 @@ export type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["get
1173
1184
  /**
1174
1185
  * Represents a Vindral client instance
1175
1186
  *
1176
- * The most most essential methods when using the Vindral class are:
1187
+ * The most essential methods when using the Vindral class are:
1177
1188
  *
1178
- * - connect() - this has to be called to actually start connecting
1189
+ * - play() - connects and starts playing; call it from a user gesture to activate audio on browsers that require one
1179
1190
  * - attach() - to attach the Vindral video view to the DOM so that users can see it
1180
- * - userInput() - to activate audio on browsers that require a user gesture to play audio
1181
1191
  * - unload() - unloads the instance, its very important that this is called when cleaning up the Vindral instance, otherwise background timers may leak.
1182
1192
  *
1183
1193
  * The Vindral instance will emit a variety of events during its lifetime. Use .on("event-name", callback) to listen to these events.
@@ -1196,8 +1206,8 @@ export type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["get
1196
1206
  * // Will be called when a user interaction is needed to activate audio
1197
1207
  * instance.on("needs user input", console.log)
1198
1208
  *
1199
- * // Start connecting to the cdn
1200
- * instance.connect()
1209
+ * // Start connecting to the cdn and playing
1210
+ * instance.play()
1201
1211
  *
1202
1212
  * // Attach the video view to the DOM
1203
1213
  * instance.attach(document.getElementById("root"))
@@ -1569,6 +1579,11 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1569
1579
  */
1570
1580
  getCastOptions: () => Options;
1571
1581
  private onConnectInfo;
1582
+ /**
1583
+ * The connection closed because media queued ahead of the pong for seconds, so the current level doesn't fit the
1584
+ * link. Lower the target below it before the rejoin, which otherwise asks for the same quality again.
1585
+ */
1586
+ private stepDownForRejoin;
1572
1587
  private emitLanguagesIfChanged;
1573
1588
  private updateTextTracks;
1574
1589
  private cleanupTextTracks;
@@ -1767,6 +1782,7 @@ interface ConnectionStatistics {
1767
1782
  * When connectionProtocol is "moq_ws", indicates why WebSocket was used instead of WebTransport.
1768
1783
  * - "unsupported": browser doesn't support WebTransport
1769
1784
  * - "disabled": webtransportEnabled option is false
1785
+ * - "disabled_unstable_browser": browser with unstable WebTransport, and unstableWebtransportEnabled option is false
1770
1786
  * - "unavailable": edge did not offer a WebTransport endpoint
1771
1787
  * - "fallback": WebTransport was attempted but failed or timed out
1772
1788
  * Unset while reconnecting; once disconnected, the last connection's.
@@ -1787,7 +1803,7 @@ export interface LanguageSwitchContext {
1787
1803
  */
1788
1804
  export interface ChannelSwitchContext {
1789
1805
  /**
1790
- * The new channel id that was switched to
1806
+ * The new channel on "channel switch", the current channel on "channel switch failed"
1791
1807
  */
1792
1808
  channelId: string;
1793
1809
  }
@@ -1895,12 +1911,12 @@ export interface PublicVindralEvents {
1895
1911
  "is live": boolean;
1896
1912
  /**
1897
1913
  * Emitted when a channel switch has been completed and the first frame of the new channel is rendered.
1898
- * A string containing the channel id of the new channel is provided as an argument.
1914
+ * The argument holds the channel id of the new channel.
1899
1915
  */
1900
1916
  "channel switch": Readonly<ChannelSwitchContext>;
1901
1917
  /**
1902
- * Emmitted when a channel switch fails.
1903
- * A string containing the channel id of the current channel is provided as an argument.
1918
+ * Emitted when a channel switch fails.
1919
+ * The argument holds the channel id of the current channel.
1904
1920
  */
1905
1921
  "channel switch failed": Readonly<ChannelSwitchContext>;
1906
1922
  /**