shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
236 stars 63 forks source link

Pre-loading a Service Certificate #109

Closed yuta-n-play closed 4 years ago

yuta-n-play commented 4 years ago

I want to know how to do Pre-loading a Service Certificate with Shaka player embedded. I know that Shaka-player can set preloaded server certificate to serverCertificate of DrmInfo. (https://shaka-player-demo.appspot.com/docs/api/shaka.extern.html#.DrmInfo)

I want to do the same with Shaka player embedded. But configure method can only specify boolean, Double or String for argument, not Uint8Array...

TheModMaker commented 4 years ago

We don't support that yet. Since this is an optimization and not required, adding this won't be a high priority; but we'll try to add it to v1.0.

yuta-n-play commented 4 years ago

Since this is almost a required function for us, we would highly appreciate if this could be done as soon as possible.

Thanks!

joeyparrish commented 4 years ago

Could you help us understand why it's required? The Widevine CDM will fetch this certificate whenever it's needed, so why would preloading the certificate be required?

If you can explain that, it will help us prioritize the work appropriately.

yuta-n-play commented 4 years ago

Umm , "Required" was exaggerated... But, without it, we needs to modify the proxy.

Our proxy does not consider CERTIFICATE_REQUEST. And certificate is an influence of "License Wrapping".

I know how to handling CERTIFICATE_REQUEST according to sample proxy , but we want to avoid proxy changes as much as possible.

joeyparrish commented 4 years ago

Ah, I see. That makes sense.

We will add this feature to try to make this easier for you. This is currently scheduled for our v1.0 release, but if you can't wait for that, I would encourage you to follow the sample proxy's example to add support for certificate requests.

yuta-n-play commented 4 years ago

OK , thanks!

TheModMaker commented 4 years ago

Now you can run configure with a byte buffer and load the certificate. Note that for the moment, you need to escape the key-system name since we use key-paths. Follow #47 for a easier way. For now, you can do:

NSData *data = LoadCert();
[player configure:@"drm.advanced.com\\.widevine\\.alpha.serverCertificate"
         withData:data];