Skip to content

Commit

Permalink
[Add] : PallyCon Multi-DRM webOS TV Sample
Browse files Browse the repository at this point in the history
  • Loading branch information
yhpark-inka committed May 8, 2024
1 parent aa94b67 commit 57b4289
Show file tree
Hide file tree
Showing 4 changed files with 2,866 additions and 0 deletions.
10 changes: 10 additions & 0 deletions appinfo.json
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"
}
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions index.html
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 = "eyJrZXlfcm90YXRpb24iOmZhbHNlLCJyZXNwb25zZV9mb3JtYXQiOiJvcmlnaW5hbCIsInVzZXJfaWQiOiJwYWxseWNvbiIsImRybV90eXBlIjoid2lkZXZpbmUiLCJzaXRlX2lkIjoiREVNTyIsImhhc2giOiIyYm0ybGJFTXc1VkZ4NUt3WDVUdFVhSXB1a3VQNmMyNkhNSWYxU09oY3lZPSIsImNpZCI6IlRlc3RSdW5uZXIiLCJwb2xpY3kiOiI5V3FJV2tkaHB4VkdLOFBTSVljbkpzY3Z1QTlzeGd1YkxzZCthanVcL2JvbVFaUGJxSSt4YWVZZlFvY2NrdnVFZkFhcWRXNWhYZ0pOZ2NTUzNmUzdvOE5zandzempNdXZ0KzBRekxrWlZWTm14MGtlZk9lMndDczJUSVRnZFU0QnZOOWFiaGQwclFrTUlybW9JZW9KSHFJZUhjUnZWZjZUMTRSbVRBREVwQ1k3UEhmUGZcL1ZGWVwvVmJYdXhYXC9XVHRWYXM0T1VwQ0RkNW0xc3BUWG04RFwvTUhGcGlieWZacERMRnBHeFArNkR4OThKSXhtTmFwWmRaRmlTTXB3aVpZRTIiLCJ0aW1lc3RhbXAiOiIyMDI0LTA0LTIzVDA1OjI3OjU3WiJ9";
const pallyconPlayReadyToken = "eyJrZXlfcm90YXRpb24iOmZhbHNlLCJyZXNwb25zZV9mb3JtYXQiOiJvcmlnaW5hbCIsInVzZXJfaWQiOiJwYWxseWNvbiIsImRybV90eXBlIjoicGxheXJlYWR5Iiwic2l0ZV9pZCI6IkRFTU8iLCJoYXNoIjoic0VRV212U2JXUmRDcTkrR3VSXC9rNlFcL0xzMnhZZ3YyenhmWkwrK3R4V1pNPSIsImNpZCI6IlRlc3RSdW5uZXIiLCJwb2xpY3kiOiI5V3FJV2tkaHB4VkdLOFBTSVljbkpzY3Z1QTlzeGd1YkxzZCthanVcL2JvbVFaUGJxSSt4YWVZZlFvY2NrdnVFZkFhcWRXNWhYZ0pOZ2NTUzNmUzdvOE5zandzempNdXZ0KzBRekxrWlZWTm14MGtlZk9lMndDczJUSVRnZFU0QnZOOWFiaGQwclFrTUlybW9JZW9KSHFJZUhjUnZWZjZUMTRSbVRBREVwQ1k3UEhmUGZcL1ZGWVwvVmJYdXhYXC9XVHRWYXM0T1VwQ0RkNW0xc3BUWG04RFwvTUhGcGlieWZacERMRnBHeFArNkR4OThKSXhtTmFwWmRaRmlTTXB3aVpZRTIiLCJ0aW1lc3RhbXAiOiIyMDI0LTA0LTI3VDAyOjMzOjMyWiJ9";

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>
Loading

0 comments on commit 57b4289

Please sign in to comment.