DRM on Roku
THEOplayer supports FairPlay, PlayReady and Widevine by default. To use these DRM systems, you will need to pass a DRM
configuration along with the source object. We are partnered with many multi-DRM vendors to make it as easy as possible
to get your DRM streams running.
Custom configuration
Developers can use the generic DRM-functionalities in case in-house DRM-solutions are used, or services from DRM-vendors for which no integration is available.
If you are integrating Widevine DRM, first make sure your Roku application's manifest file contains the following
entries:
requires_widevine_drm=1
requires_widevine_version=1.0
In order to play DRM protected resources, you will need to pass extra DRM parameters. To see what kind of DRM protection is supported by Roku devices, please visit this page.
In the following example, there is a function called "setSource", which sets the source of a THEOplayer instance ("m.player.source").
It is worth mentioning that "m" works like the "this" keyword from other languages. An "m" keyword points to the current component local namespace. Therefore, in case you want to access a variable across different functions inside the same component, use "m" to do so.
function setSource(streamFormat)
if streamFormat = "hls" then
drmParams = {
"widevine": {
"licenseAcquisitionURL": "<LICENSE_KEY_URL_WIDEVINE>"
}
}
m.player.source = {
"poster": "poster.png",
"sources": [
{
"contentProtection": drmParams,
"src": "<HLS_STREAM_URL>",
"type": "application/x-mpegURL"
}
]
}
end if
if streamFormat = "dash" then
drmParams = {
"widevine": {
"licenseAcquisitionURL": "<LICENSE_KEY_URL_WIDEVINE>"
},
"playready": {
"licenseAcquisitionURL": "<LICENSE_KEY_URL_PLAYREADY>"
}
}
m.player.source = {
"poster": "poster.png",
"sources": [
{
"contentProtection": drmParams,
"src": "<DASH_STREAM_URL>",
"type": "application/dash+xml"
}
]
}
end if
end function
For more advanced configurations, consult the content protection API documentation.
Custom integration
Developers can make their own custom DRM integration for any DRM vendor. This can be done by making use of the DRM integration API repository.
A complete guide on how to create a new integration, and some example integrations can be found in the provided repository.