@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/legacy.d.ts CHANGED
@@ -132,7 +132,7 @@ declare class UserAgentInformation {
132
132
  };
133
133
  }
134
134
  export type AudioCodec = "aac" | "opus" | "mp3";
135
- export type VideoCodec = "h264" | "av1";
135
+ export type VideoCodec = "h264" | "h265" | "av1";
136
136
  /**
137
137
  * The current reconnect state to use to decide whether to kep reconnecting or not
138
138
  */
@@ -484,8 +484,8 @@ interface TrackObject {
484
484
  displayWidth?: number;
485
485
  displayHeight?: number;
486
486
  language?: string;
487
- ["com.vindral.variant_uid"]?: string;
488
- ["com.vindral.drm"]?: string;
487
+ "com.vindral.variant_uid"?: string;
488
+ "com.vindral.drm"?: string;
489
489
  }
490
490
  interface CatalogRoot {
491
491
  version: number;
@@ -921,6 +921,7 @@ interface JitterModuleStatistics {
921
921
  interface MseModuleStatistics {
922
922
  quotaErrorCount: number;
923
923
  mediaSourceOpenTime: number;
924
+ playbackStallCount: number;
924
925
  totalVideoFrames?: number;
925
926
  droppedVideoFrames?: number;
926
927
  successfulVideoAppendCalls?: number;
@@ -1296,6 +1297,14 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1296
1297
  * setting targetBufferTime within that range for consistancy if using both min/max.
1297
1298
  */
1298
1299
  set targetBufferTime(bufferTimeMs: number);
1300
+ /**
1301
+ * Update the dynamic buffer time configuration at runtime.
1302
+ * Allows adjusting min and max buffer time without recreating the Vindral instance.
1303
+ */
1304
+ updateBufferTimeConfig(config: {
1305
+ minBufferTime?: number;
1306
+ maxBufferTime?: number;
1307
+ }): void;
1299
1308
  /**
1300
1309
  * The estimated playback latency based on target buffer time, the connection rtt and local playback drift
1301
1310
  */
@@ -1533,6 +1542,8 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1533
1542
  private suspend;
1534
1543
  private unsuspend;
1535
1544
  private getRuntimeInfo;
1545
+ private getPlaybackBufferState;
1546
+ private onMediaElementBufferState;
1536
1547
  private onMediaElementState;
1537
1548
  private onBufferEvent;
1538
1549
  /**
@@ -1650,7 +1661,7 @@ export interface PublicVindralEvents {
1650
1661
  * 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
1651
1662
  * 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.
1652
1663
  */
1653
- ["error"]: Readonly<VindralError>;
1664
+ error: Readonly<VindralError>;
1654
1665
  /**
1655
1666
  * When the instance needs user input to activate audio or sometimes video playback.
1656
1667
  * Is called with an object
@@ -1661,51 +1672,51 @@ export interface PublicVindralEvents {
1661
1672
  * }
1662
1673
  * ```
1663
1674
  */
1664
- ["needs user input"]: NeedsUserInputContext;
1675
+ "needs user input": NeedsUserInputContext;
1665
1676
  /**
1666
1677
  * When a timed metadata event has been triggered
1667
1678
  */
1668
- ["metadata"]: Readonly<Metadata>;
1679
+ metadata: Readonly<Metadata>;
1669
1680
  /**
1670
1681
  * When the playback state changes
1671
1682
  */
1672
- ["playback state"]: Readonly<PlaybackState>;
1683
+ "playback state": Readonly<PlaybackState>;
1673
1684
  /**
1674
1685
  * When the connection state changes
1675
1686
  */
1676
- ["connection state"]: Readonly<ConnectionState>;
1687
+ "connection state": Readonly<ConnectionState>;
1677
1688
  /**
1678
1689
  * When the available rendition levels is changed
1679
1690
  */
1680
- ["rendition levels"]: ReadonlyArray<RenditionLevel>;
1691
+ "rendition levels": ReadonlyArray<RenditionLevel>;
1681
1692
  /**
1682
1693
  * When the rendition level is changed
1683
1694
  */
1684
- ["rendition level"]: Readonly<RenditionLevel>;
1695
+ "rendition level": Readonly<RenditionLevel>;
1685
1696
  /**
1686
1697
  * When the available languages is changed
1687
1698
  */
1688
- ["languages"]: ReadonlyArray<string>;
1699
+ languages: ReadonlyArray<string>;
1689
1700
  /**
1690
1701
  * When the available text tracks are changed
1691
1702
  */
1692
- ["text tracks"]: ReadonlyArray<string>;
1703
+ "text tracks": ReadonlyArray<string>;
1693
1704
  /**
1694
1705
  * When the available channels is changed
1695
1706
  */
1696
- ["channels"]: ReadonlyArray<Channel>;
1707
+ channels: ReadonlyArray<Channel>;
1697
1708
  /**
1698
1709
  * When a context switch state change has occured.
1699
1710
  * E.g. when a channel change has been requested, or quality is changed.
1700
1711
  */
1701
- ["context switch"]: Readonly<ContextSwitchState>;
1712
+ "context switch": Readonly<ContextSwitchState>;
1702
1713
  /**
1703
1714
  * Emitted when a wallclock time message has been received from the server.
1704
1715
  *
1705
1716
  * Note: This is the edge server wallclock time and thus may differ slightly
1706
1717
  * between two viewers if they are connected to different edge servers.
1707
1718
  */
1708
- ["server wallclock time"]: Readonly<number>;
1719
+ "server wallclock time": Readonly<number>;
1709
1720
  /**
1710
1721
  * Is emitted during connection whether the channel is live or not.
1711
1722
  *
@@ -1715,41 +1726,41 @@ export interface PublicVindralEvents {
1715
1726
  * Note: If the web-sdk is instantiated at the same time as you are starting the stream it is possible
1716
1727
  * that this emits false until the started state has propagated through the system.
1717
1728
  */
1718
- ["is live"]: boolean;
1729
+ "is live": boolean;
1719
1730
  /**
1720
1731
  * Emitted when a channel switch has been completed and the first frame of the new channel is rendered.
1721
1732
  * A string containing the channel id of the new channel is provided as an argument.
1722
1733
  */
1723
- ["channel switch"]: Readonly<ChannelSwitchContext>;
1734
+ "channel switch": Readonly<ChannelSwitchContext>;
1724
1735
  /**
1725
1736
  * Emmitted when a channel switch fails.
1726
1737
  * A string containing the channel id of the current channel is provided as an argument.
1727
1738
  */
1728
- ["channel switch failed"]: Readonly<ChannelSwitchContext>;
1739
+ "channel switch failed": Readonly<ChannelSwitchContext>;
1729
1740
  /**
1730
1741
  * Emitted when a language switch has been completed and the new language starts playing.
1731
1742
  */
1732
- ["language switch"]: Readonly<LanguageSwitchContext>;
1743
+ "language switch": Readonly<LanguageSwitchContext>;
1733
1744
  /**
1734
1745
  * Emitted when the volume state changes.
1735
1746
  *
1736
1747
  * This is triggered triggered both when the user changes the volume through the Vindral instance, but also
1737
1748
  * from external sources such as OS media shortcuts or other native UI outside of the browser.
1738
1749
  */
1739
- ["volume state"]: Readonly<VolumeState>;
1750
+ "volume state": Readonly<VolumeState>;
1740
1751
  /**
1741
1752
  * Emitted when the timeshift URLs are updated.
1742
1753
  */
1743
- ["timeshift info"]: Readonly<TimeShiftInfo>;
1754
+ "timeshift info": Readonly<TimeShiftInfo>;
1744
1755
  /**
1745
1756
  * Emitted for each CMAF fragment received via the MoQ/VoQ path.
1746
1757
  * Contains raw fMP4 bytes suitable for recording.
1747
1758
  *
1748
1759
  * @internal Not part of the public API — may change without notice.
1749
1760
  */
1750
- ["cmaf fragment"]: Readonly<CmafFragmentEvent>;
1751
- ["buffer state event"]: Readonly<BufferStateEvent>;
1752
- ["initialized media"]: void;
1761
+ "cmaf fragment": Readonly<CmafFragmentEvent>;
1762
+ "buffer state event": Readonly<BufferStateEvent>;
1763
+ "initialized media": void;
1753
1764
  }
1754
1765
  /**
1755
1766
  * Available events to listen to
@@ -1758,27 +1769,27 @@ export interface CastSenderEvents {
1758
1769
  /**
1759
1770
  * When a connection has been established with a CastReceiver
1760
1771
  */
1761
- ["connected"]: void;
1772
+ connected: void;
1762
1773
  /**
1763
1774
  * When a previous session has been resumed
1764
1775
  */
1765
- ["resumed"]: void;
1776
+ resumed: void;
1766
1777
  /**
1767
1778
  * When a CastReceiver has lost or stopped a connection
1768
1779
  */
1769
- ["disconnected"]: void;
1780
+ disconnected: void;
1770
1781
  /**
1771
1782
  * When a connection attempt was initiated unsuccessfully
1772
1783
  */
1773
- ["failed"]: void;
1784
+ failed: void;
1774
1785
  /**
1775
1786
  * When the remote connection emits a metadata event
1776
1787
  */
1777
- ["metadata"]: Metadata;
1788
+ metadata: Metadata;
1778
1789
  /**
1779
1790
  * When the remote connection receives a server wallclock time event
1780
1791
  */
1781
- ["server wallclock time"]: number;
1792
+ "server wallclock time": number;
1782
1793
  }
1783
1794
  /**
1784
1795
  * Used for initializing the CastSender
@@ -1874,15 +1885,15 @@ interface AirPlaySenderEvents {
1874
1885
  /**
1875
1886
  * When airplay targets are available.
1876
1887
  */
1877
- ["available"]: void;
1888
+ available: void;
1878
1889
  /**
1879
1890
  * When a connection has been established with an airplay target.
1880
1891
  */
1881
- ["connected"]: void;
1892
+ connected: void;
1882
1893
  /**
1883
1894
  * When the airplay target has lost or stopped a connection.
1884
1895
  */
1885
- ["disconnected"]: void;
1896
+ disconnected: void;
1886
1897
  }
1887
1898
  interface AirPlayConfig {
1888
1899
  /**