Multi-DRM integration sample for LG webOS TV application
This document explains how to play PallyCon Multi-DRM
content on webOS TV via Shaka Player
.
- webOS TV 5.0 and later
- The sample in this document was tested on LG 32SR85U(webOS 23).
- The emulator does not support DRM, so you must have a physical TV device.
- webOS Studio Installation
- App Testing with Developer Mode App
You can see a more detailed development flow in webOS TV Developer Workflow.
Shaka Player is an Google open-source JavaScript library for adaptive media. It plays adaptive media formats (such as DASH, HLS and MSS) in a browser, without using plugins or Flash. Instead, Shaka Player uses the open web standards MediaSource Extensions and Encrypted Media Extensions.
-
Add the
Shaka Player
Javascript library.<!-- index.html --> <head> // shaka Player <script src="shaka-player-4.8.0/shaka-player.compiled.debug.js" charset="utf-8"></script> </head>
-
In the
index.html
filestartPlayer()
function, enter thePallyCon Multi-DRM
licence server address in theplayer.configure
value.// index.html player.configure({ drm: { // PallyCon License Request URL servers: { "com.widevine.alpha": "https://license-global.pallycon.com/ri/licenseManager.do" } //servers: { // "com.microsoft.playready": "https://license-global.pallycon.com/ri/licenseManager.do" //} } });
-
Set the licence acquisition token in the
startPlayer()
function of theindex.html
file.// index.html player.getNetworkingEngine().registerRequestFilter(function(type, request) { if (type == shaka.net.NetworkingEngine.RequestType.LICENSE) { // http header(custom data) request.headers["pallycon-customdata-v2"] = "PallyCon Multi-DRM License Request Token"; } });