-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Add] : PallyCon Multi-DRM webOS TV Sample
- Loading branch information
1 parent
aa94b67
commit 57b4289
Showing
4 changed files
with
2,866 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"vendor": "PallyCon Multi-DRM", | ||
"largeIcon": "icon.png", | ||
"icon": "icon.png", | ||
"main": "index.html", | ||
"id": "com.pallycon.webos.shaka", | ||
"title": "PallyCon Multi-DRM", | ||
"type": "web", | ||
"version": "1.0.0" | ||
} |
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,59 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<!-- shaka Player --> | ||
<script src="shaka-player-4.8.0/shaka-player.compiled.debug.js" charset="utf-8"></script> | ||
<title>PallyCon Multi-DRM on WebOS TV</title> | ||
</head> | ||
<body> | ||
<video id="video" width="100%" height="100%" controls autoplay></video> | ||
<script> | ||
const contentUrl = "https://contents.pallycon.com/TEST/PACKAGED_CONTENT/TEST_SIMPLE/dash/stream.mpd"; | ||
//const pallyconWidevineToken = "eyJrZXlfcm90YXRpb24iOmZhbHNlLCJyZXNwb25zZV9mb3JtYXQiOiJvcmlnaW5hbCIsInVzZXJfaWQiOiJwYWxseWNvbiIsImRybV90eXBlIjoid2lkZXZpbmUiLCJzaXRlX2lkIjoiREVNTyIsImhhc2giOiIyYm0ybGJFTXc1VkZ4NUt3WDVUdFVhSXB1a3VQNmMyNkhNSWYxU09oY3lZPSIsImNpZCI6IlRlc3RSdW5uZXIiLCJwb2xpY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LTA0LTI3VDAyOjMzOjMyWiJ9"; | ||
|
||
function onErrorEvent(event) { | ||
onError(event.detail); | ||
} | ||
|
||
function onError(error) { | ||
console.error('Error code', error.code, 'object', error); | ||
} | ||
|
||
function startPlayer() { | ||
const video = document.getElementById('video'); | ||
const player = new shaka.Player(video); | ||
|
||
player.addEventListener('error', onErrorEvent); | ||
|
||
player.getNetworkingEngine().registerRequestFilter(function(type, request) { | ||
if (type == shaka.net.NetworkingEngine.RequestType.LICENSE) { | ||
// custom data | ||
request.headers["pallycon-customdata-v2"] = pallyconPlayReadyToken; | ||
} | ||
}); | ||
|
||
player.configure({ | ||
drm: { | ||
// 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"} | ||
} | ||
}); | ||
|
||
try { | ||
player.load(contentUrl); | ||
} catch (e) { | ||
onError(e); | ||
} | ||
} | ||
|
||
shaka.polyfill.installAll(); | ||
if (shaka.Player.isBrowserSupported()) { | ||
startPlayer(); | ||
} else { | ||
console.error('Browser not supported!'); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.