@vindral/web-sdk 3.3.0 → 3.3.2

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
@@ -10,6 +10,8 @@ Make sure to check out the [Web SDK guides](https://docs.vindral.com/playout/web
10
10
 
11
11
  [Check out our demo](https://demo.vindral.com/) to see some of Vindral's features.
12
12
 
13
+ For detailed information about our latest updates, visit the [changelog](https://docs.vindral.com/web-sdk/changelog/).
14
+
13
15
  ## Getting Started
14
16
 
15
17
  There are multiple ways to integrate the Web SDK, depending on the use case.
package/index.d.ts CHANGED
@@ -368,6 +368,7 @@ interface ClientOverrides {
368
368
  burstEnabled?: boolean;
369
369
  sizeBasedResolutionCapEnabled?: boolean;
370
370
  separateVideoSocketEnabled?: boolean;
371
+ videoCodecs?: string[];
371
372
  }
372
373
  interface ChannelWithRenditionsAndOverrides extends Channel {
373
374
  renditions: Rendition[];
@@ -979,6 +980,11 @@ declare class UserAgentInformation {
979
980
  private highEntropyValues?;
980
981
  constructor();
981
982
  getUserAgentInformation(): {
983
+ locationOrigin: string;
984
+ locationPath: string;
985
+ ancestorOrigins: string[] | undefined;
986
+ hardwareConcurrency: number;
987
+ deviceMemory: number | undefined;
982
988
  userAgentLegacy: string;
983
989
  ua: {
984
990
  browser: {
@@ -993,17 +999,13 @@ declare class UserAgentInformation {
993
999
  major_version: number;
994
1000
  };
995
1001
  };
996
- locationOrigin: string;
997
- locationPath: string;
998
- ancestorOrigins: string[] | undefined;
999
- userAgent?: undefined;
1000
1002
  } | {
1001
- userAgent: string;
1002
1003
  locationOrigin: string;
1003
1004
  locationPath: string;
1004
1005
  ancestorOrigins: string[] | undefined;
1005
- userAgentLegacy?: undefined;
1006
- ua?: undefined;
1006
+ hardwareConcurrency: number;
1007
+ deviceMemory: number | undefined;
1008
+ userAgent: string;
1007
1009
  };
1008
1010
  }
1009
1011
  type ModuleStatistics = AdaptivityStatistics & BufferTimeStatistics & ConnectionStatistics & ConstraintCapStatistics & DecoderStatistics & DocumentStateModulesStatistics & IncomingDataModuleStatistics & MseModuleStatistics & PlaybackModuleStatistics & QualityOfServiceModuleStatistics & RenditionsModuleStatistics & SyncModuleStatistics & TelemetryModuleStatistics & VideoPlayerStatistics;
@@ -1410,6 +1412,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1410
1412
  * Pauses the stream. Call .play() to resume playback again.
1411
1413
  */
1412
1414
  pause: () => void;
1415
+ private registerDebugInstance;
1413
1416
  /**
1414
1417
  *
1415
1418
  * Start playing the stream.
@@ -1453,6 +1456,73 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1453
1456
  private timeToFirstFrame;
1454
1457
  private willUseMediaSource;
1455
1458
  }
1459
+ interface AirPlaySenderEvents {
1460
+ /**
1461
+ * When airplay targets are available.
1462
+ */
1463
+ ["available"]: void;
1464
+ /**
1465
+ * When a connection has been established with an airplay target.
1466
+ */
1467
+ ["connected"]: void;
1468
+ /**
1469
+ * When the airplay target has lost or stopped a connection.
1470
+ */
1471
+ ["disconnected"]: void;
1472
+ }
1473
+ interface AirPlayConfig {
1474
+ /**
1475
+ * URL to use when connecting to the stream.
1476
+ */
1477
+ url: string;
1478
+ /**
1479
+ * Channel ID to connect to.
1480
+ */
1481
+ channelId: string;
1482
+ /**
1483
+ * A container to attach the video element in. This should be the same container that the vindral video element is attached to.
1484
+ */
1485
+ container: HTMLElement;
1486
+ /**
1487
+ * An authentication token to provide to the server when connecting - only needed for channels with authentication enabled
1488
+ * Note: If not supplied when needed, an "Authentication Failed" error will be raised.
1489
+ */
1490
+ authenticationToken?: string;
1491
+ }
1492
+ declare class AirPlaySender extends Emitter<AirPlaySenderEvents> {
1493
+ private config;
1494
+ private hlsUrl;
1495
+ private element;
1496
+ private connectingTimeout?;
1497
+ private browser;
1498
+ constructor(config: AirPlayConfig);
1499
+ /**
1500
+ * True if the instance is casting right now.
1501
+ */
1502
+ get casting(): boolean;
1503
+ /**
1504
+ * Set the current channelId.
1505
+ */
1506
+ set channelId(channelId: string);
1507
+ /**
1508
+ * Update authentication token on an already established and authenticated connection.
1509
+ */
1510
+ updateAuthenticationToken: (_token: string) => void;
1511
+ /**
1512
+ * Fully unloads the instance. This disconnects the current listeners.
1513
+ */
1514
+ unload: () => void;
1515
+ /**
1516
+ * Show the AirPlay picker.
1517
+ */
1518
+ showPlaybackTargetPicker(): void;
1519
+ /**
1520
+ * Returns if AirPlay is supported.
1521
+ */
1522
+ static isAirPlaySupported(): boolean;
1523
+ private onAirPlayAvailable;
1524
+ private onAirPlayPlaybackChanged;
1525
+ }
1456
1526
  /**
1457
1527
  * Available options when initializing the Player. Used for enabling/disabling features
1458
1528
  * and hiding/showing buttons in the control pane
@@ -1527,6 +1597,10 @@ export interface PlayerOptions {
1527
1597
  * Enable or disable the pause and play button
1528
1598
  */
1529
1599
  pauseButtonEnabled?: boolean;
1600
+ /**
1601
+ * Enable or disable the AirPlay button
1602
+ */
1603
+ airPlayButtonEnabled?: boolean;
1530
1604
  }
1531
1605
  /**
1532
1606
  * Represents a Vindral player
@@ -1548,6 +1622,10 @@ export declare class Player {
1548
1622
  * The CastSender instance
1549
1623
  */
1550
1624
  readonly castSender: CastSender;
1625
+ /**
1626
+ * The AirPlaySender instance
1627
+ */
1628
+ readonly airPlaySender?: AirPlaySender;
1551
1629
  private options;
1552
1630
  private state;
1553
1631
  private playerElement;
@@ -1569,6 +1647,7 @@ export declare class Player {
1569
1647
  */
1570
1648
  attach: (container: HTMLElement) => void;
1571
1649
  private setupCastSender;
1650
+ private setupAirPlaySender;
1572
1651
  private onMouseMove;
1573
1652
  private onClick;
1574
1653
  private togglePip;
@@ -1595,6 +1674,10 @@ export declare class Player {
1595
1674
  * Exit fullscreen mode
1596
1675
  */
1597
1676
  exitFullscreen: () => Promise<void>;
1677
+ /**
1678
+ * Show the AirPlay picker
1679
+ */
1680
+ showAirPlayPicker: () => void;
1598
1681
  private lockOrientation;
1599
1682
  private unlockOrientation;
1600
1683
  private checkState;