chemoish / videojs-fairplay

Video.js source handler for supporting Fairplay streaming.
MIT License
23 stars 10 forks source link

Support for custom `fetchLicense` method #14

Open boushley opened 7 years ago

boushley commented 7 years ago

Would you be open to a PR that allows someone to pass a custom fetchLicense method as an option?

I have to needs that this would address:

  1. My license URL endpoint requires the value of the skd:// url to be appended as a URL parameter. This value is generally not available when setting the video source, so can't be provided in the normal options.

  2. License acquisition calls will fail in with my DRM backend unless a "viewing session" is active. Viewing sessions are torn down after the video is paused for some period of time. So when the user requests the video to play again I setup a new viewing session and then can process license acquisition calls. By having a custom function I can pass in, I can manage all of this logic without needing to modify the core DRM solution.

If we added an option to override the fetchLicense method we would probably want to update the options passed to the fetchLicense method to include a success and error handler provided by the library.

If this is something you're open to, I'll write it up and open a PR so we can discuss the exact details.

chemoish commented 6 years ago

GG, I apologize for not responding.

I have been away from video for quite some time. If you haven't forked this already and are still interested in opening a PR, please do. Feel free to email me as I do not always get notifications from Github.