@vindral/web-sdk 4.2.0 → 4.2.1-10-ga7cb21ca

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.2.0",
2
+ "version": "4.2.1-10-ga7cb21ca",
3
3
  "name": "@vindral/web-sdk",
4
4
  "main": "./legacy.umd.js",
5
5
  "module": "./legacy.es.js",
package/player.d.ts CHANGED
@@ -129,7 +129,7 @@ declare class UserAgentInformation {
129
129
  };
130
130
  }
131
131
  type AudioCodec = "aac" | "opus" | "mp3";
132
- type VideoCodec = "h264" | "av1";
132
+ type VideoCodec = "h264" | "h265" | "av1";
133
133
  interface ReconnectState {
134
134
  /**
135
135
  * The number or retry attempts so far.
@@ -462,8 +462,8 @@ interface TrackObject {
462
462
  displayWidth?: number;
463
463
  displayHeight?: number;
464
464
  language?: string;
465
- ["com.vindral.variant_uid"]?: string;
466
- ["com.vindral.drm"]?: string;
465
+ "com.vindral.variant_uid"?: string;
466
+ "com.vindral.drm"?: string;
467
467
  }
468
468
  interface CatalogRoot {
469
469
  version: number;
@@ -691,6 +691,7 @@ declare class ApiClient {
691
691
  private toChannels;
692
692
  private toChannel;
693
693
  }
694
+ type TransportSelectionReason = "unsupported" | "disabled" | "unavailable" | "fallback";
694
695
  interface AdaptivityStatistics {
695
696
  /**
696
697
  * True if adaptive bitrate (ABR) is enabled.
@@ -830,6 +831,7 @@ interface JitterModuleStatistics {
830
831
  interface MseModuleStatistics {
831
832
  quotaErrorCount: number;
832
833
  mediaSourceOpenTime: number;
834
+ playbackStallCount: number;
833
835
  totalVideoFrames?: number;
834
836
  droppedVideoFrames?: number;
835
837
  successfulVideoAppendCalls?: number;
@@ -1161,6 +1163,14 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1161
1163
  * setting targetBufferTime within that range for consistancy if using both min/max.
1162
1164
  */
1163
1165
  set targetBufferTime(bufferTimeMs: number);
1166
+ /**
1167
+ * Update the dynamic buffer time configuration at runtime.
1168
+ * Allows adjusting min and max buffer time without recreating the Vindral instance.
1169
+ */
1170
+ updateBufferTimeConfig(config: {
1171
+ minBufferTime?: number;
1172
+ maxBufferTime?: number;
1173
+ }): void;
1164
1174
  /**
1165
1175
  * The estimated playback latency based on target buffer time, the connection rtt and local playback drift
1166
1176
  */
@@ -1398,6 +1408,8 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1398
1408
  private suspend;
1399
1409
  private unsuspend;
1400
1410
  private getRuntimeInfo;
1411
+ private getPlaybackBufferState;
1412
+ private onMediaElementBufferState;
1401
1413
  private onMediaElementState;
1402
1414
  private onBufferEvent;
1403
1415
  /**
@@ -1454,6 +1466,14 @@ interface ConnectionStatistics {
1454
1466
  */
1455
1467
  connectionSuccessRatio: number;
1456
1468
  connectionProtocol: "vindral_ws" | "moq" | "moq_ws" | undefined;
1469
+ /**
1470
+ * When connectionProtocol is "moq_ws", indicates why WebSocket was used instead of WebTransport.
1471
+ * - "unsupported": browser doesn't support WebTransport
1472
+ * - "disabled": webtransportEnabled option is false
1473
+ * - "unavailable": edge did not offer a WebTransport endpoint
1474
+ * - "fallback": WebTransport was attempted but failed or timed out
1475
+ */
1476
+ transportSelectionReason: TransportSelectionReason | undefined;
1457
1477
  }
1458
1478
  interface LanguageSwitchContext {
1459
1479
  /**
@@ -1496,7 +1516,7 @@ interface PublicVindralEvents {
1496
1516
  * In case of a fatal error it is appropriate to indicate what the error was to the user, either by displaying the error.message or
1497
1517
  * by using the error.code() as a key to look up a localization string. To resume streaming it is required to create a new Vindral instance.
1498
1518
  */
1499
- ["error"]: Readonly<VindralError>;
1519
+ error: Readonly<VindralError>;
1500
1520
  /**
1501
1521
  * When the instance needs user input to activate audio or sometimes video playback.
1502
1522
  * Is called with an object
@@ -1507,51 +1527,51 @@ interface PublicVindralEvents {
1507
1527
  * }
1508
1528
  * ```
1509
1529
  */
1510
- ["needs user input"]: NeedsUserInputContext;
1530
+ "needs user input": NeedsUserInputContext;
1511
1531
  /**
1512
1532
  * When a timed metadata event has been triggered
1513
1533
  */
1514
- ["metadata"]: Readonly<Metadata>;
1534
+ metadata: Readonly<Metadata>;
1515
1535
  /**
1516
1536
  * When the playback state changes
1517
1537
  */
1518
- ["playback state"]: Readonly<PlaybackState>;
1538
+ "playback state": Readonly<PlaybackState>;
1519
1539
  /**
1520
1540
  * When the connection state changes
1521
1541
  */
1522
- ["connection state"]: Readonly<ConnectionState>;
1542
+ "connection state": Readonly<ConnectionState>;
1523
1543
  /**
1524
1544
  * When the available rendition levels is changed
1525
1545
  */
1526
- ["rendition levels"]: ReadonlyArray<RenditionLevel>;
1546
+ "rendition levels": ReadonlyArray<RenditionLevel>;
1527
1547
  /**
1528
1548
  * When the rendition level is changed
1529
1549
  */
1530
- ["rendition level"]: Readonly<RenditionLevel>;
1550
+ "rendition level": Readonly<RenditionLevel>;
1531
1551
  /**
1532
1552
  * When the available languages is changed
1533
1553
  */
1534
- ["languages"]: ReadonlyArray<string>;
1554
+ languages: ReadonlyArray<string>;
1535
1555
  /**
1536
1556
  * When the available text tracks are changed
1537
1557
  */
1538
- ["text tracks"]: ReadonlyArray<string>;
1558
+ "text tracks": ReadonlyArray<string>;
1539
1559
  /**
1540
1560
  * When the available channels is changed
1541
1561
  */
1542
- ["channels"]: ReadonlyArray<Channel>;
1562
+ channels: ReadonlyArray<Channel>;
1543
1563
  /**
1544
1564
  * When a context switch state change has occured.
1545
1565
  * E.g. when a channel change has been requested, or quality is changed.
1546
1566
  */
1547
- ["context switch"]: Readonly<ContextSwitchState>;
1567
+ "context switch": Readonly<ContextSwitchState>;
1548
1568
  /**
1549
1569
  * Emitted when a wallclock time message has been received from the server.
1550
1570
  *
1551
1571
  * Note: This is the edge server wallclock time and thus may differ slightly
1552
1572
  * between two viewers if they are connected to different edge servers.
1553
1573
  */
1554
- ["server wallclock time"]: Readonly<number>;
1574
+ "server wallclock time": Readonly<number>;
1555
1575
  /**
1556
1576
  * Is emitted during connection whether the channel is live or not.
1557
1577
  *
@@ -1561,41 +1581,41 @@ interface PublicVindralEvents {
1561
1581
  * Note: If the web-sdk is instantiated at the same time as you are starting the stream it is possible
1562
1582
  * that this emits false until the started state has propagated through the system.
1563
1583
  */
1564
- ["is live"]: boolean;
1584
+ "is live": boolean;
1565
1585
  /**
1566
1586
  * Emitted when a channel switch has been completed and the first frame of the new channel is rendered.
1567
1587
  * A string containing the channel id of the new channel is provided as an argument.
1568
1588
  */
1569
- ["channel switch"]: Readonly<ChannelSwitchContext>;
1589
+ "channel switch": Readonly<ChannelSwitchContext>;
1570
1590
  /**
1571
1591
  * Emmitted when a channel switch fails.
1572
1592
  * A string containing the channel id of the current channel is provided as an argument.
1573
1593
  */
1574
- ["channel switch failed"]: Readonly<ChannelSwitchContext>;
1594
+ "channel switch failed": Readonly<ChannelSwitchContext>;
1575
1595
  /**
1576
1596
  * Emitted when a language switch has been completed and the new language starts playing.
1577
1597
  */
1578
- ["language switch"]: Readonly<LanguageSwitchContext>;
1598
+ "language switch": Readonly<LanguageSwitchContext>;
1579
1599
  /**
1580
1600
  * Emitted when the volume state changes.
1581
1601
  *
1582
1602
  * This is triggered triggered both when the user changes the volume through the Vindral instance, but also
1583
1603
  * from external sources such as OS media shortcuts or other native UI outside of the browser.
1584
1604
  */
1585
- ["volume state"]: Readonly<VolumeState>;
1605
+ "volume state": Readonly<VolumeState>;
1586
1606
  /**
1587
1607
  * Emitted when the timeshift URLs are updated.
1588
1608
  */
1589
- ["timeshift info"]: Readonly<TimeShiftInfo>;
1609
+ "timeshift info": Readonly<TimeShiftInfo>;
1590
1610
  /**
1591
1611
  * Emitted for each CMAF fragment received via the MoQ/VoQ path.
1592
1612
  * Contains raw fMP4 bytes suitable for recording.
1593
1613
  *
1594
1614
  * @internal Not part of the public API — may change without notice.
1595
1615
  */
1596
- ["cmaf fragment"]: Readonly<CmafFragmentEvent>;
1597
- ["buffer state event"]: Readonly<BufferStateEvent>;
1598
- ["initialized media"]: void;
1616
+ "cmaf fragment": Readonly<CmafFragmentEvent>;
1617
+ "buffer state event": Readonly<BufferStateEvent>;
1618
+ "initialized media": void;
1599
1619
  }
1600
1620
  declare abstract class VindralButton extends HTMLElement {
1601
1621
  #private;
@@ -1609,17 +1629,6 @@ declare abstract class VindralButton extends HTMLElement {
1609
1629
  attributeChangedCallback(name: string, _old: string, value: string): void;
1610
1630
  protected abstract handleClick(e: Event): void;
1611
1631
  }
1612
- export declare class AirPlayButton extends VindralButton {
1613
- #private;
1614
- static observedAttributes: string[];
1615
- constructor();
1616
- connectedCallback(): void;
1617
- disconnectedCallback(): void;
1618
- attributeChangedCallback(name: string, old: string, value: string): void;
1619
- set isAirPlaying(value: boolean);
1620
- get isAirPlaying(): boolean;
1621
- protected handleClick(_: Event): void;
1622
- }
1623
1632
  declare class VindralMenuButton extends VindralButton {
1624
1633
  #private;
1625
1634
  constructor();
@@ -1651,6 +1660,17 @@ declare class AdvancedRenditionMenuList extends HTMLElement {
1651
1660
  handleEvent: (event: Event) => void;
1652
1661
  focus(): void;
1653
1662
  }
1663
+ export declare class AirPlayButton extends VindralButton {
1664
+ #private;
1665
+ static observedAttributes: string[];
1666
+ constructor();
1667
+ connectedCallback(): void;
1668
+ disconnectedCallback(): void;
1669
+ attributeChangedCallback(name: string, old: string, value: string): void;
1670
+ set isAirPlaying(value: boolean);
1671
+ get isAirPlaying(): boolean;
1672
+ protected handleClick(_: Event): void;
1673
+ }
1654
1674
  declare class BufferingIcon extends HTMLElement {
1655
1675
  #private;
1656
1676
  static observedAttributes: "buffering"[];
@@ -1742,15 +1762,15 @@ interface AirPlaySenderEvents {
1742
1762
  /**
1743
1763
  * When airplay targets are available.
1744
1764
  */
1745
- ["available"]: void;
1765
+ available: void;
1746
1766
  /**
1747
1767
  * When a connection has been established with an airplay target.
1748
1768
  */
1749
- ["connected"]: void;
1769
+ connected: void;
1750
1770
  /**
1751
1771
  * When the airplay target has lost or stopped a connection.
1752
1772
  */
1753
- ["disconnected"]: void;
1773
+ disconnected: void;
1754
1774
  }
1755
1775
  interface AirPlayConfig {
1756
1776
  /**
@@ -1809,7 +1829,7 @@ declare class AirPlaySender extends Emitter<AirPlaySenderEvents> {
1809
1829
  private checkHlsUrl;
1810
1830
  }
1811
1831
  interface FullscreenEvents {
1812
- ["on fullscreen change"]: boolean;
1832
+ "on fullscreen change": boolean;
1813
1833
  }
1814
1834
  declare class Fullscreen extends Emitter<FullscreenEvents> {
1815
1835
  private container;
@@ -1830,7 +1850,7 @@ type ControllerAttributes = (typeof Controller.observedAttributes)[number];
1830
1850
  export declare class Controller extends HTMLElement {
1831
1851
  #private;
1832
1852
  static observedAttributes: readonly [
1833
- ...("language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src")[],
1853
+ ...("language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src" | "debug-panel-open" | "target-buffer-time" | "drift" | "playback-latency" | "connection-state")[],
1834
1854
  "url",
1835
1855
  "edge-url",
1836
1856
  "target-buffer-time",
@@ -1952,7 +1972,7 @@ export declare class PlayButton extends VindralButton {
1952
1972
  */
1953
1973
  export declare class Player extends HTMLElement {
1954
1974
  #private;
1955
- static observedAttributes: readonly ("title" | "offline" | "advanced" | "poster" | "language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src" | "url" | "decoders" | "edge-url" | "target-buffer-time" | "cast-receiver-id" | "cast-background" | "log-level" | "max-size" | "min-buffer-time" | "max-buffer-time" | "max-audio-bit-rate" | "burst-enabled" | "mse-enabled" | "mse-opus-enabled" | "ios-background-play-enabled" | "ios-wake-lock-enabled" | "stream-to-media-element-enabled" | "ios-media-element-enabled" | "telemetry-enabled" | "video-codecs" | "drm-headers" | "drm-queryparams" | "drm-widevine-video-robustness" | "drm-widevine-audio-robustness" | "drm-playready-video-robustness" | "drm-playready-audio-robustness" | "webtransport-enabled" | "webcodecs-hardware-acceleration" | "offscreen-canvas-enabled" | "reconnect-retries" | "auto-instance-enabled" | "advanced-rendition-menu-enabled" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1975
+ static observedAttributes: readonly ("title" | "offline" | "advanced" | "poster" | "language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src" | "debug-panel-open" | "target-buffer-time" | "drift" | "playback-latency" | "connection-state" | "url" | "decoders" | "min-buffer-time" | "max-buffer-time" | "edge-url" | "cast-receiver-id" | "cast-background" | "log-level" | "max-size" | "max-audio-bit-rate" | "burst-enabled" | "mse-enabled" | "mse-opus-enabled" | "ios-background-play-enabled" | "ios-wake-lock-enabled" | "stream-to-media-element-enabled" | "ios-media-element-enabled" | "telemetry-enabled" | "video-codecs" | "drm-headers" | "drm-queryparams" | "drm-widevine-video-robustness" | "drm-widevine-audio-robustness" | "drm-playready-video-robustness" | "drm-playready-audio-robustness" | "webtransport-enabled" | "webcodecs-hardware-acceleration" | "offscreen-canvas-enabled" | "reconnect-retries" | "auto-instance-enabled" | "advanced-rendition-menu-enabled" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1956
1976
  constructor();
1957
1977
  connectedCallback(): void;
1958
1978
  disconnectedCallback(): void;
@@ -2069,6 +2089,14 @@ export declare class VolumeRange extends VindralRange {
2069
2089
  * Register custom elements for the Vindral player
2070
2090
  */
2071
2091
  export declare function registerComponents(): void;
2092
+ /**
2093
+ * Register debug custom elements for the Vindral player.
2094
+ *
2095
+ * Call this in addition to `registerComponents()` to enable the debug button and panel.
2096
+ * Without calling this, `<vindral-debug-button>` and `<vindral-debug-panel>` remain
2097
+ * inert and the debug code is tree-shaken from the bundle.
2098
+ */
2099
+ export declare function registerDebugComponents(): void;
2072
2100
  /**
2073
2101
  * @ignore
2074
2102
  */