Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat / add playlist and media entitlement #70

Merged
merged 18 commits into from
May 30, 2022

Conversation

ChristiaanScheermeijer
Copy link
Collaborator

@ChristiaanScheermeijer ChristiaanScheermeijer commented May 23, 2022

Description

  • Add contentSigningService to config
  • Get a (DRM) token for all playlist calls (including search and recommendations)
  • Get a (DRM) token for media call on Movie and Series screens
  • Get a fresh (DRM) token when starting video playback
  • Get tokens for the getMediaByIds

Fixes #23

@ChristiaanScheermeijer ChristiaanScheermeijer marked this pull request as ready for review May 25, 2022 18:54
src/hooks/useMedia.ts Outdated Show resolved Hide resolved
src/hooks/useSignedUrl.ts Outdated Show resolved Hide resolved
src/hooks/useSignedUrl.ts Outdated Show resolved Hide resolved
@@ -4,7 +4,7 @@ import { QueryClient, QueryClientProvider } from 'react-query';
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 3600,
staleTime: 60 * 60 * 1000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch with the missing ms multiplier. Do you think an hour is a good default though or potentially long for all but the most basic config values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, the default staleTime is 5 minutes which is a bit short in my opinion. The data doesn't change that often.

It does provide a more pleasant browsing experience, especially with URL signing (DRM) since all requests take longer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the signed urls / drm urls only worked for a short time

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The video DRM tokens are, but that doesn't count for the media/playlist metadata requests as long it's cached. We still do need to invalidate the token after 15 minutes so that we don't risk using invalidated tokens.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so the strategy is to use an hour for the default for things that can be cached indefinitely, and then control invalidation for other things manually?

@ChristiaanScheermeijer
Copy link
Collaborator Author

Thanks @dbudzins, I've pushed one more commit which removes a redundant playlist filter (which is moved to the API service).

@ChristiaanScheermeijer ChristiaanScheermeijer merged commit 8839d0b into develop May 30, 2022
@ChristiaanScheermeijer ChristiaanScheermeijer deleted the feat/url-signing-and-drm branch May 30, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VOD DRM Support
2 participants