-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add Widevine Service Certificate tutorial (#5018)
Also fixes a related typo in the FairPlay tutorial and adds a missing entry to the tutorial index.
- Loading branch information
1 parent
412a25c
commit 4e65a46
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Widevine Service Certificates | ||
|
||
With Widevine, you can eliminate one round-trip to your license server or proxy | ||
per session by preloading a Widevine service certificate. You can either provide | ||
it directly or set a URI and let Shaka fetch it for you. Do this before calling | ||
`player.load()`. The values will persist across multiple calls to `load()` on | ||
the same `shaka.Player` instance. | ||
|
||
```js | ||
// This is an example of loading the certificate from your site at runtime. | ||
// You could also choose to bundle it into your JavaScript as a Uint8Array. | ||
const req = await fetch('https://example.com/service.cert'); | ||
const cert = new Uint8Array(await req.arrayBuffer()); | ||
|
||
// This is the short form for configuration of a certificate: | ||
player.configure('drm.advanced.com\\.widevine\\.alpha.serverCertificate', | ||
cert); | ||
|
||
// This is the long form: | ||
player.configure({ | ||
drm: { | ||
advanced: { | ||
'com.widevine.alpha': { | ||
'serverCertificate': cert, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
|
||
// This is the short form for configuration of a certificate URI: | ||
player.configure('drm.advanced.com\\.widevine\\.alpha.serverCertificateUri', | ||
'https://example.com/service.cert'); | ||
|
||
// This is the long form: | ||
player.configure({ | ||
drm: { | ||
advanced: { | ||
'com.widevine.alpha': { | ||
'serverCertificateUri': 'https://example.com/service.cert', | ||
}, | ||
}, | ||
}, | ||
}); | ||
``` |