Skip to content

Commit

Permalink
chore: bring back playerLicenseKey
Browse files Browse the repository at this point in the history
  • Loading branch information
mustran committed Nov 7, 2024
1 parent 19e4ca4 commit 9ab8b86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/ui-react/src/components/Player/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const Player: React.FC<Props> = ({
const { settings } = useConfigStore((s) => s);

const playerId = settings.playerId;
const playerLicenseKey = settings.playerLicenseKey;

const handleBeforePlay = useEventCallback(onBeforePlay);
const handlePlay = useEventCallback(onPlay);
Expand Down Expand Up @@ -214,6 +215,10 @@ const Player: React.FC<Props> = ({
playerOptions.autostart = autostart;
}

// Set the license key if provided
if (playerLicenseKey) {
playerOptions.key = playerLicenseKey;
}
playerRef.current.setup(playerOptions);

attachEvents();
Expand All @@ -226,7 +231,7 @@ const Player: React.FC<Props> = ({
if (libLoaded) {
initializePlayer();
}
}, [libLoaded, item, detachEvents, attachEvents, playerId, autostart, adsData, sources, feedId]);
}, [libLoaded, item, detachEvents, attachEvents, playerId, autostart, adsData, playerLicenseKey, sources, feedId]);

useEffect(() => {
return () => {
Expand Down

0 comments on commit 9ab8b86

Please sign in to comment.