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

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.mjs CHANGED
@@ -1116,6 +1116,7 @@ html[dir=rtl] .shaka-overflow-menu .shaka-overflow-button .material-svg-icon:fir
1116
1116
 
1117
1117
  // src/Player.tsx
1118
1118
  import { forwardRef, useEffect as useEffect5, useRef as useRef8, useImperativeHandle, useCallback as useCallback8 } from "react";
1119
+ import shaka3 from "shaka-player/dist/shaka-player.ui";
1119
1120
 
1120
1121
  // src/hooks/useShakaPlayer.ts
1121
1122
  import { useRef, useCallback, useState } from "react";
@@ -1169,7 +1170,7 @@ var supportsWidevinePersistentLicenses = () => {
1169
1170
  import initShakaPlayerMux from "@mux/mux-data-shakaplayer";
1170
1171
 
1171
1172
  // package.json
1172
- var version = "1.0.1-rc.50";
1173
+ var version = "1.0.1-rc.52";
1173
1174
 
1174
1175
  // src/utils/licenseCache.ts
1175
1176
  var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
@@ -3571,6 +3572,7 @@ var Player = forwardRef(
3571
3572
  shakaConfig,
3572
3573
  drmConfig,
3573
3574
  muxConfig,
3575
+ system73Config,
3574
3576
  imaConfig,
3575
3577
  chromecastConfig,
3576
3578
  qualityConfig,
@@ -3580,6 +3582,7 @@ var Player = forwardRef(
3580
3582
  containerClassName,
3581
3583
  ...videoProps
3582
3584
  }, ref) => {
3585
+ console.log("system73Config", system73Config);
3583
3586
  const videoRef = useRef8(null);
3584
3587
  const containerRef = useRef8(null);
3585
3588
  useImperativeHandle(ref, () => videoRef.current, []);
@@ -3648,6 +3651,26 @@ var Player = forwardRef(
3648
3651
  showPulseAnimation: true,
3649
3652
  liveThresholdSeconds: 15
3650
3653
  });
3654
+ const initializeSystem73 = useCallback8((playerConfig) => {
3655
+ if (!system73Config?.apiKey || !window.S73ShakaPlayerWrapper) {
3656
+ return null;
3657
+ }
3658
+ console.log("Initializing System73 SDK...");
3659
+ try {
3660
+ const s73Config = {
3661
+ apiKey: system73Config.apiKey,
3662
+ contentSteeringEndpoint: system73Config.contentSteeringEndpoint,
3663
+ channelId: system73Config.channelId
3664
+ };
3665
+ const wrapper = window.S73ShakaPlayerWrapper(s73Config, { shaka: shaka3 });
3666
+ wrapper.wrapPlayerConfig(playerConfig);
3667
+ console.log("System73 SDK initialized with config:", s73Config);
3668
+ return wrapper;
3669
+ } catch (error) {
3670
+ console.error("Error initializing System73 SDK:", error);
3671
+ return null;
3672
+ }
3673
+ }, [system73Config]);
3651
3674
  const initializeAds = useCallback8(() => {
3652
3675
  if (!imaConfig?.adTagUrl || !playerRef.current || !videoRef.current || !uiRef.current) {
3653
3676
  return;
@@ -3679,7 +3702,19 @@ var Player = forwardRef(
3679
3702
  if (!video) return;
3680
3703
  const initialize = async () => {
3681
3704
  try {
3705
+ let system73Wrapper = null;
3706
+ if (system73Config?.apiKey) {
3707
+ const playerConfig = { ...shakaConfig };
3708
+ system73Wrapper = initializeSystem73(playerConfig);
3709
+ if (system73Wrapper) {
3710
+ shakaConfig = playerConfig;
3711
+ }
3712
+ }
3682
3713
  await initializePlayer(video);
3714
+ if (system73Wrapper && playerRef.current) {
3715
+ system73Wrapper.wrapPlayer(playerRef.current);
3716
+ console.log("System73 player wrapper applied");
3717
+ }
3683
3718
  setupEventListeners();
3684
3719
  const cleanupQuality = setupQualityTracking();
3685
3720
  configureQuality();