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

Change vod_hls_encryption_method based on arg or header #1549

Open
aminvakil opened this issue Nov 4, 2024 · 2 comments
Open

Change vod_hls_encryption_method based on arg or header #1549

aminvakil opened this issue Nov 4, 2024 · 2 comments

Comments

@aminvakil
Copy link

aminvakil commented Nov 4, 2024

I was wondering if vod_hls_encryption_method could be changed based on each request for the same location.

We need to disable encryption for custom devices, and as disabling it everywhere requires to purge all caches at once, it is not acceptable for us. Therefore we want to add a specific query parameter which instructs the vod-module to either disable vod_hls_encryption_method or not, and purge cache by time.

So far I have understood that it cannot be given a custom variable and it has been set an enum in source code that does not accept any value expect what that has been defined.

Also we've added NGX_HTTP_SIF_CONF to its definition and was able to define it in an if condition in server block, but it wasn't enabled at all.

It seems like it cannot get changed on runtime, am I right?

@erankor
Copy link
Contributor

erankor commented Nov 9, 2024

Yes, this directive does not support variables. But the point about caching didn't make much sense to me...
If you are caching the segments (using a CDN or whatever), you must use different URLs for encrypted / non-encrypted streams, otherwise you can have a mix of encrypted / clear segments in the CDN, and it won't play.
You can use 2 locations, e.g. /hls and /hlsenc (encrypted), and redirect the master.m3u8 request to one of them according to the type of device.

@aminvakil
Copy link
Author

Yes, but aside from query param we have a cache_key which changes when a media gets changed, we wanted to prepend something like noenc to it.

Separate locations seems to be the only way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants