videojs / videojs-contrib-hls

HLS library for video.js
http://videojs.github.io/videojs-contrib-hls/
Other
2.84k stars 793 forks source link

Cache encryption keys #1433

Closed benwilber closed 5 years ago

benwilber commented 6 years ago

Description

See: https://github.com/videojs/videojs-contrib-hls/issues/1395

AES encryption keys are fetched for every segment even if the same key is used to encrypt multiple segments (per HLS specification.) This causes unnecessary load on the key server if access to encryption keys are guarded by user-specific authentication and authorization mechanisms.

Specific Changes proposed

Cache encryption keys based on their resolved URI and only fetch keys when they're needed to decrypt the next series of segments.

Requirements Checklist

This is a rather crude PR because it doesn't update the tests (they fail now) and I'm not even sure this is the correct way to implement this. I'm not very experienced with this tech stack (I can't figure out how the testing libraries are supposed to work) so this is more "request for guidance" to implement this bug fix.

All feedback or assistance is welcome!

aaronchenweb commented 6 years ago

I got same problem, please help

forbesjo commented 6 years ago

@benwilber are you still interested in this feature?

benwilber commented 6 years ago

@forbesjo Yes I am still interested in implementing this fix. Unfortunately I'm not very familiar with this tech stack and have been having trouble updating the tests so that this case is properly covered. If anybody could provide any assistance, or point me in the right direction I would appreciate it.

Thanks!

forbesjo commented 5 years ago

Thank you for your PR but we will not be accepting new changes for this repo and will be archived very soon. I would advise you to open your PR against the next iteration of this project at https://github.com/videojs/http-streaming.