@vindral/web-sdk 4.2.0 → 4.2.1

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",
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;
@@ -830,6 +830,7 @@ interface JitterModuleStatistics {
830
830
  interface MseModuleStatistics {
831
831
  quotaErrorCount: number;
832
832
  mediaSourceOpenTime: number;
833
+ playbackStallCount: number;
833
834
  totalVideoFrames?: number;
834
835
  droppedVideoFrames?: number;
835
836
  successfulVideoAppendCalls?: number;
@@ -1161,6 +1162,14 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1161
1162
  * setting targetBufferTime within that range for consistancy if using both min/max.
1162
1163
  */
1163
1164
  set targetBufferTime(bufferTimeMs: number);
1165
+ /**
1166
+ * Update the dynamic buffer time configuration at runtime.
1167
+ * Allows adjusting min and max buffer time without recreating the Vindral instance.
1168
+ */
1169
+ updateBufferTimeConfig(config: {
1170
+ minBufferTime?: number;
1171
+ maxBufferTime?: number;
1172
+ }): void;
1164
1173
  /**
1165
1174
  * The estimated playback latency based on target buffer time, the connection rtt and local playback drift
1166
1175
  */
@@ -1398,6 +1407,8 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1398
1407
  private suspend;
1399
1408
  private unsuspend;
1400
1409
  private getRuntimeInfo;
1410
+ private getPlaybackBufferState;
1411
+ private onMediaElementBufferState;
1401
1412
  private onMediaElementState;
1402
1413
  private onBufferEvent;
1403
1414
  /**
@@ -1496,7 +1507,7 @@ interface PublicVindralEvents {
1496
1507
  * 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
1508
  * 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
1509
  */
1499
- ["error"]: Readonly<VindralError>;
1510
+ error: Readonly<VindralError>;
1500
1511
  /**
1501
1512
  * When the instance needs user input to activate audio or sometimes video playback.
1502
1513
  * Is called with an object
@@ -1507,51 +1518,51 @@ interface PublicVindralEvents {
1507
1518
  * }
1508
1519
  * ```
1509
1520
  */
1510
- ["needs user input"]: NeedsUserInputContext;
1521
+ "needs user input": NeedsUserInputContext;
1511
1522
  /**
1512
1523
  * When a timed metadata event has been triggered
1513
1524
  */
1514
- ["metadata"]: Readonly<Metadata>;
1525
+ metadata: Readonly<Metadata>;
1515
1526
  /**
1516
1527
  * When the playback state changes
1517
1528
  */
1518
- ["playback state"]: Readonly<PlaybackState>;
1529
+ "playback state": Readonly<PlaybackState>;
1519
1530
  /**
1520
1531
  * When the connection state changes
1521
1532
  */
1522
- ["connection state"]: Readonly<ConnectionState>;
1533
+ "connection state": Readonly<ConnectionState>;
1523
1534
  /**
1524
1535
  * When the available rendition levels is changed
1525
1536
  */
1526
- ["rendition levels"]: ReadonlyArray<RenditionLevel>;
1537
+ "rendition levels": ReadonlyArray<RenditionLevel>;
1527
1538
  /**
1528
1539
  * When the rendition level is changed
1529
1540
  */
1530
- ["rendition level"]: Readonly<RenditionLevel>;
1541
+ "rendition level": Readonly<RenditionLevel>;
1531
1542
  /**
1532
1543
  * When the available languages is changed
1533
1544
  */
1534
- ["languages"]: ReadonlyArray<string>;
1545
+ languages: ReadonlyArray<string>;
1535
1546
  /**
1536
1547
  * When the available text tracks are changed
1537
1548
  */
1538
- ["text tracks"]: ReadonlyArray<string>;
1549
+ "text tracks": ReadonlyArray<string>;
1539
1550
  /**
1540
1551
  * When the available channels is changed
1541
1552
  */
1542
- ["channels"]: ReadonlyArray<Channel>;
1553
+ channels: ReadonlyArray<Channel>;
1543
1554
  /**
1544
1555
  * When a context switch state change has occured.
1545
1556
  * E.g. when a channel change has been requested, or quality is changed.
1546
1557
  */
1547
- ["context switch"]: Readonly<ContextSwitchState>;
1558
+ "context switch": Readonly<ContextSwitchState>;
1548
1559
  /**
1549
1560
  * Emitted when a wallclock time message has been received from the server.
1550
1561
  *
1551
1562
  * Note: This is the edge server wallclock time and thus may differ slightly
1552
1563
  * between two viewers if they are connected to different edge servers.
1553
1564
  */
1554
- ["server wallclock time"]: Readonly<number>;
1565
+ "server wallclock time": Readonly<number>;
1555
1566
  /**
1556
1567
  * Is emitted during connection whether the channel is live or not.
1557
1568
  *
@@ -1561,41 +1572,41 @@ interface PublicVindralEvents {
1561
1572
  * Note: If the web-sdk is instantiated at the same time as you are starting the stream it is possible
1562
1573
  * that this emits false until the started state has propagated through the system.
1563
1574
  */
1564
- ["is live"]: boolean;
1575
+ "is live": boolean;
1565
1576
  /**
1566
1577
  * Emitted when a channel switch has been completed and the first frame of the new channel is rendered.
1567
1578
  * A string containing the channel id of the new channel is provided as an argument.
1568
1579
  */
1569
- ["channel switch"]: Readonly<ChannelSwitchContext>;
1580
+ "channel switch": Readonly<ChannelSwitchContext>;
1570
1581
  /**
1571
1582
  * Emmitted when a channel switch fails.
1572
1583
  * A string containing the channel id of the current channel is provided as an argument.
1573
1584
  */
1574
- ["channel switch failed"]: Readonly<ChannelSwitchContext>;
1585
+ "channel switch failed": Readonly<ChannelSwitchContext>;
1575
1586
  /**
1576
1587
  * Emitted when a language switch has been completed and the new language starts playing.
1577
1588
  */
1578
- ["language switch"]: Readonly<LanguageSwitchContext>;
1589
+ "language switch": Readonly<LanguageSwitchContext>;
1579
1590
  /**
1580
1591
  * Emitted when the volume state changes.
1581
1592
  *
1582
1593
  * This is triggered triggered both when the user changes the volume through the Vindral instance, but also
1583
1594
  * from external sources such as OS media shortcuts or other native UI outside of the browser.
1584
1595
  */
1585
- ["volume state"]: Readonly<VolumeState>;
1596
+ "volume state": Readonly<VolumeState>;
1586
1597
  /**
1587
1598
  * Emitted when the timeshift URLs are updated.
1588
1599
  */
1589
- ["timeshift info"]: Readonly<TimeShiftInfo>;
1600
+ "timeshift info": Readonly<TimeShiftInfo>;
1590
1601
  /**
1591
1602
  * Emitted for each CMAF fragment received via the MoQ/VoQ path.
1592
1603
  * Contains raw fMP4 bytes suitable for recording.
1593
1604
  *
1594
1605
  * @internal Not part of the public API — may change without notice.
1595
1606
  */
1596
- ["cmaf fragment"]: Readonly<CmafFragmentEvent>;
1597
- ["buffer state event"]: Readonly<BufferStateEvent>;
1598
- ["initialized media"]: void;
1607
+ "cmaf fragment": Readonly<CmafFragmentEvent>;
1608
+ "buffer state event": Readonly<BufferStateEvent>;
1609
+ "initialized media": void;
1599
1610
  }
1600
1611
  declare abstract class VindralButton extends HTMLElement {
1601
1612
  #private;
@@ -1609,17 +1620,6 @@ declare abstract class VindralButton extends HTMLElement {
1609
1620
  attributeChangedCallback(name: string, _old: string, value: string): void;
1610
1621
  protected abstract handleClick(e: Event): void;
1611
1622
  }
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
1623
  declare class VindralMenuButton extends VindralButton {
1624
1624
  #private;
1625
1625
  constructor();
@@ -1651,6 +1651,17 @@ declare class AdvancedRenditionMenuList extends HTMLElement {
1651
1651
  handleEvent: (event: Event) => void;
1652
1652
  focus(): void;
1653
1653
  }
1654
+ export declare class AirPlayButton extends VindralButton {
1655
+ #private;
1656
+ static observedAttributes: string[];
1657
+ constructor();
1658
+ connectedCallback(): void;
1659
+ disconnectedCallback(): void;
1660
+ attributeChangedCallback(name: string, old: string, value: string): void;
1661
+ set isAirPlaying(value: boolean);
1662
+ get isAirPlaying(): boolean;
1663
+ protected handleClick(_: Event): void;
1664
+ }
1654
1665
  declare class BufferingIcon extends HTMLElement {
1655
1666
  #private;
1656
1667
  static observedAttributes: "buffering"[];
@@ -1742,15 +1753,15 @@ interface AirPlaySenderEvents {
1742
1753
  /**
1743
1754
  * When airplay targets are available.
1744
1755
  */
1745
- ["available"]: void;
1756
+ available: void;
1746
1757
  /**
1747
1758
  * When a connection has been established with an airplay target.
1748
1759
  */
1749
- ["connected"]: void;
1760
+ connected: void;
1750
1761
  /**
1751
1762
  * When the airplay target has lost or stopped a connection.
1752
1763
  */
1753
- ["disconnected"]: void;
1764
+ disconnected: void;
1754
1765
  }
1755
1766
  interface AirPlayConfig {
1756
1767
  /**
@@ -1809,7 +1820,7 @@ declare class AirPlaySender extends Emitter<AirPlaySenderEvents> {
1809
1820
  private checkHlsUrl;
1810
1821
  }
1811
1822
  interface FullscreenEvents {
1812
- ["on fullscreen change"]: boolean;
1823
+ "on fullscreen change": boolean;
1813
1824
  }
1814
1825
  declare class Fullscreen extends Emitter<FullscreenEvents> {
1815
1826
  private container;
@@ -1830,7 +1841,7 @@ type ControllerAttributes = (typeof Controller.observedAttributes)[number];
1830
1841
  export declare class Controller extends HTMLElement {
1831
1842
  #private;
1832
1843
  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")[],
1844
+ ...("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
1845
  "url",
1835
1846
  "edge-url",
1836
1847
  "target-buffer-time",
@@ -1952,7 +1963,7 @@ export declare class PlayButton extends VindralButton {
1952
1963
  */
1953
1964
  export declare class Player extends HTMLElement {
1954
1965
  #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")[];
1966
+ 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
1967
  constructor();
1957
1968
  connectedCallback(): void;
1958
1969
  disconnectedCallback(): void;
@@ -2069,6 +2080,14 @@ export declare class VolumeRange extends VindralRange {
2069
2080
  * Register custom elements for the Vindral player
2070
2081
  */
2071
2082
  export declare function registerComponents(): void;
2083
+ /**
2084
+ * Register debug custom elements for the Vindral player.
2085
+ *
2086
+ * Call this in addition to `registerComponents()` to enable the debug button and panel.
2087
+ * Without calling this, `<vindral-debug-button>` and `<vindral-debug-panel>` remain
2088
+ * inert and the debug code is tree-shaken from the bundle.
2089
+ */
2090
+ export declare function registerDebugComponents(): void;
2072
2091
  /**
2073
2092
  * @ignore
2074
2093
  */