Skip to content

Commit

Permalink
fix: use content protection tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kiremitrov123 committed Mar 28, 2023
1 parent d6fffd2 commit 4e03197
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/useContentProtection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ const useContentProtection = <T>(
}));
const host = signingConfig?.host;
const drmPolicyId = contentProtection?.drm?.defaultPolicyId ?? signingConfig?.drmPolicyId;
const drmEnabled = !!drmPolicyId;
const signingEnabled = !!urlSigning;

const { data: token, isLoading } = useQuery(
['token', type, id, params],
() => {
// if provider is not JWP
if (!!id && !!host && drmEnabled) {
if (!!id && !!host && !!drmPolicyId) {
const { host, drmPolicyId } = signingConfig;
return getMediaToken(host, id, jwt, params, drmPolicyId);
}
Expand Down

0 comments on commit 4e03197

Please sign in to comment.