@mottosports/motto-video-player 1.0.1-rc.50 → 1.0.1-rc.51

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/dist/index.d.mts CHANGED
@@ -233,6 +233,10 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
233
233
  * Mux Analytics configuration
234
234
  */
235
235
  muxConfig?: MuxAnalyticsConfig;
236
+ /**
237
+ * System73 SDK configuration
238
+ */
239
+ system73Config?: System73Config;
236
240
  /**
237
241
  * IMA (Interactive Media Ads) configuration
238
242
  */
@@ -398,6 +402,36 @@ interface MuxAnalyticsConfig {
398
402
  */
399
403
  metadata?: MuxMetadata;
400
404
  }
405
+ /**
406
+ * System73 SDK configuration
407
+ */
408
+ interface System73Config {
409
+ /**
410
+ * System73 API key (required for authentication)
411
+ */
412
+ apiKey: string;
413
+ /**
414
+ * Content steering endpoint URI (optional)
415
+ */
416
+ contentSteeringEndpoint?: string;
417
+ /**
418
+ * Channel identifier (optional)
419
+ */
420
+ channelId?: string;
421
+ }
422
+ /**
423
+ * System73 SDK wrapper interface
424
+ */
425
+ declare global {
426
+ interface Window {
427
+ S73ShakaPlayerWrapper?: (config: System73Config, shakaInstance: {
428
+ shaka: any;
429
+ }) => {
430
+ wrapPlayerConfig: (config: any) => void;
431
+ wrapPlayer: (player: any) => void;
432
+ };
433
+ }
434
+ }
401
435
 
402
436
  declare global {
403
437
  namespace google {
package/dist/index.d.ts CHANGED
@@ -233,6 +233,10 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
233
233
  * Mux Analytics configuration
234
234
  */
235
235
  muxConfig?: MuxAnalyticsConfig;
236
+ /**
237
+ * System73 SDK configuration
238
+ */
239
+ system73Config?: System73Config;
236
240
  /**
237
241
  * IMA (Interactive Media Ads) configuration
238
242
  */
@@ -398,6 +402,36 @@ interface MuxAnalyticsConfig {
398
402
  */
399
403
  metadata?: MuxMetadata;
400
404
  }
405
+ /**
406
+ * System73 SDK configuration
407
+ */
408
+ interface System73Config {
409
+ /**
410
+ * System73 API key (required for authentication)
411
+ */
412
+ apiKey: string;
413
+ /**
414
+ * Content steering endpoint URI (optional)
415
+ */
416
+ contentSteeringEndpoint?: string;
417
+ /**
418
+ * Channel identifier (optional)
419
+ */
420
+ channelId?: string;
421
+ }
422
+ /**
423
+ * System73 SDK wrapper interface
424
+ */
425
+ declare global {
426
+ interface Window {
427
+ S73ShakaPlayerWrapper?: (config: System73Config, shakaInstance: {
428
+ shaka: any;
429
+ }) => {
430
+ wrapPlayerConfig: (config: any) => void;
431
+ wrapPlayer: (player: any) => void;
432
+ };
433
+ }
434
+ }
401
435
 
402
436
  declare global {
403
437
  namespace google {
package/dist/index.js CHANGED
@@ -1157,6 +1157,7 @@ html[dir=rtl] .shaka-overflow-menu .shaka-overflow-button .material-svg-icon:fir
1157
1157
 
1158
1158
  // src/Player.tsx
1159
1159
  var import_react12 = require("react");
1160
+ var import_shaka_player4 = __toESM(require("shaka-player/dist/shaka-player.ui"));
1160
1161
 
1161
1162
  // src/hooks/useShakaPlayer.ts
1162
1163
  var import_react = require("react");
@@ -1210,7 +1211,7 @@ var supportsWidevinePersistentLicenses = () => {
1210
1211
  var import_mux_data_shakaplayer = __toESM(require("@mux/mux-data-shakaplayer"));
1211
1212
 
1212
1213
  // package.json
1213
- var version = "1.0.1-rc.50";
1214
+ var version = "1.0.1-rc.51";
1214
1215
 
1215
1216
  // src/utils/licenseCache.ts
1216
1217
  var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
@@ -3612,6 +3613,7 @@ var Player = (0, import_react12.forwardRef)(
3612
3613
  shakaConfig,
3613
3614
  drmConfig,
3614
3615
  muxConfig,
3616
+ system73Config,
3615
3617
  imaConfig,
3616
3618
  chromecastConfig,
3617
3619
  qualityConfig,
@@ -3689,6 +3691,26 @@ var Player = (0, import_react12.forwardRef)(
3689
3691
  showPulseAnimation: true,
3690
3692
  liveThresholdSeconds: 15
3691
3693
  });
3694
+ const initializeSystem73 = (0, import_react12.useCallback)((playerConfig) => {
3695
+ if (!system73Config?.apiKey || !window.S73ShakaPlayerWrapper) {
3696
+ return null;
3697
+ }
3698
+ console.log("Initializing System73 SDK...");
3699
+ try {
3700
+ const s73Config = {
3701
+ apiKey: system73Config.apiKey,
3702
+ contentSteeringEndpoint: system73Config.contentSteeringEndpoint,
3703
+ channelId: system73Config.channelId
3704
+ };
3705
+ const wrapper = window.S73ShakaPlayerWrapper(s73Config, { shaka: import_shaka_player4.default });
3706
+ wrapper.wrapPlayerConfig(playerConfig);
3707
+ console.log("System73 SDK initialized with config:", s73Config);
3708
+ return wrapper;
3709
+ } catch (error) {
3710
+ console.error("Error initializing System73 SDK:", error);
3711
+ return null;
3712
+ }
3713
+ }, [system73Config]);
3692
3714
  const initializeAds = (0, import_react12.useCallback)(() => {
3693
3715
  if (!imaConfig?.adTagUrl || !playerRef.current || !videoRef.current || !uiRef.current) {
3694
3716
  return;
@@ -3720,7 +3742,19 @@ var Player = (0, import_react12.forwardRef)(
3720
3742
  if (!video) return;
3721
3743
  const initialize = async () => {
3722
3744
  try {
3745
+ let system73Wrapper = null;
3746
+ if (system73Config?.apiKey) {
3747
+ const playerConfig = { ...shakaConfig };
3748
+ system73Wrapper = initializeSystem73(playerConfig);
3749
+ if (system73Wrapper) {
3750
+ shakaConfig = playerConfig;
3751
+ }
3752
+ }
3723
3753
  await initializePlayer(video);
3754
+ if (system73Wrapper && playerRef.current) {
3755
+ system73Wrapper.wrapPlayer(playerRef.current);
3756
+ console.log("System73 player wrapper applied");
3757
+ }
3724
3758
  setupEventListeners();
3725
3759
  const cleanupQuality = setupQualityTracking();
3726
3760
  configureQuality();