Skip to content

Commit

Permalink
fix(i18n): protected media not translated
Browse files Browse the repository at this point in the history
  • Loading branch information
royschut committed Nov 26, 2024
1 parent 4ae0b7e commit 5de64b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/hooks-react/src/useProtectedMedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import ApiService from '@jwp/ott-common/src/services/ApiService';
import { getModule } from '@jwp/ott-common/src/modules/container';
import AccessController from '@jwp/ott-common/src/controllers/AccessController';
import { useConfigStore } from '@jwp/ott-common/src/stores/ConfigStore';
import { useTranslation } from 'react-i18next';

import useContentProtection from './useContentProtection';

export default function useProtectedMedia(item: PlaylistItem) {
const apiService = getModule(ApiService);
const accessController = getModule(AccessController);
const { i18n } = useTranslation();
const { language } = i18n;

const { isAccessBridgeEnabled } = useConfigStore(({ settings }) => ({
isAccessBridgeEnabled: !!settings?.apiAccessBridgeUrl,
Expand All @@ -23,7 +26,7 @@ export default function useProtectedMedia(item: PlaylistItem) {
}

// If Access Bridge is not enabled, retrieve the media using the provided DRM token and policy ID.
return apiService.getMediaById({ id: item.mediaid, token, drmPolicyId });
return apiService.getMediaById({ id: item.mediaid, token, drmPolicyId, language });
});

const { isLoading, data: isGeoBlocked } = useQuery(
Expand Down

0 comments on commit 5de64b7

Please sign in to comment.