Skip to content

Commit

Permalink
Add warning to DRM samples if not using https protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed Nov 1, 2021
1 parent 4079679 commit 0d1a4c3
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 1 deletion.
17 changes: 17 additions & 0 deletions samples/drm/clearkey.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
player.initialize(video, url, true);
player.setProtectionData(protData);
}
function check() {
if (location.protocol === 'http:' && location.hostname !== 'localhost') {
var out = 'This page has been loaded under http. This might result in the EME APIs not being available to the player and any DRM-protected content will fail to play. ' +
'If you wish to test manifest URLs that require EME support, then <a href=\'https:' + window.location.href.substring(window.location.protocol.length) + '\'>reload this page under https</a>.'
var div = document.getElementById('http-warning');
div.innerHTML = out;
div.style.display = ''
}
}
</script>
</head>
<body>
Expand All @@ -46,6 +55,13 @@
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger" role="alert" style="display: none" id="http-warning">

</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="h-100 p-5 bg-light border rounded-3">
Expand Down Expand Up @@ -73,6 +89,7 @@ <h3>Clearkey DRM instantiation example</h3>

<script>
document.addEventListener('DOMContentLoaded', function () {
check();
init();
});
</script>
Expand Down
17 changes: 17 additions & 0 deletions samples/drm/dashif-laurl.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
player.initialize(video, url, true);
player.setProtectionData(protData);
}
function check() {
if (location.protocol === 'http:' && location.hostname !== 'localhost') {
var out = 'This page has been loaded under http. This might result in the EME APIs not being available to the player and any DRM-protected content will fail to play. ' +
'If you wish to test manifest URLs that require EME support, then <a href=\'https:' + window.location.href.substring(window.location.protocol.length) + '\'>reload this page under https</a>.'
var div = document.getElementById('http-warning');
div.innerHTML = out;
div.style.display = ''
}
}
</script>
</head>
<body>
Expand All @@ -58,6 +67,13 @@
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger" role="alert" style="display: none" id="http-warning">

</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="h-100 p-5 bg-light border rounded-3">
Expand Down Expand Up @@ -87,6 +103,7 @@ <h3>Widevine DRM instantiation example</h3>

<script>
document.addEventListener('DOMContentLoaded', function () {
check();
init();
});
</script>
Expand Down
17 changes: 17 additions & 0 deletions samples/drm/license-wrapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
player.initialize(video, url, true);
player.setProtectionData(protData);
}
function check() {
if (location.protocol === 'http:' && location.hostname !== 'localhost') {
var out = 'This page has been loaded under http. This might result in the EME APIs not being available to the player and any DRM-protected content will fail to play. ' +
'If you wish to test manifest URLs that require EME support, then <a href=\'https:' + window.location.href.substring(window.location.protocol.length) + '\'>reload this page under https</a>.'
var div = document.getElementById('http-warning');
div.innerHTML = out;
div.style.display = ''
}
}
</script>
</head>
<body>
Expand All @@ -65,6 +74,13 @@
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger" role="alert" style="display: none" id="http-warning">

</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="h-100 p-5 bg-light border rounded-3">
Expand Down Expand Up @@ -94,6 +110,7 @@ <h3>License wrapping example</h3>

<script>
document.addEventListener('DOMContentLoaded', function () {
check();
init();
});
</script>
Expand Down
17 changes: 17 additions & 0 deletions samples/drm/playready.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
player.initialize(video, url, true);
player.setProtectionData(protData);
}
function check() {
if (location.protocol === 'http:' && location.hostname !== 'localhost') {
var out = 'This page has been loaded under http. This might result in the EME APIs not being available to the player and any DRM-protected content will fail to play. ' +
'If you wish to test manifest URLs that require EME support, then <a href=\'https:' + window.location.href.substring(window.location.protocol.length) + '\'>reload this page under https</a>.'
var div = document.getElementById('http-warning');
div.innerHTML = out;
div.style.display = ''
}
}
</script>
</head>
<body>
Expand All @@ -47,6 +56,13 @@
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger" role="alert" style="display: none" id="http-warning">

</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="h-100 p-5 bg-light border rounded-3">
Expand Down Expand Up @@ -74,6 +90,7 @@ <h3>PlayReady DRM instantiation example</h3>

<script>
document.addEventListener('DOMContentLoaded', function () {
check();
init();
});
</script>
Expand Down
17 changes: 17 additions & 0 deletions samples/drm/system-priority.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
player.initialize(video, url, true);
player.setProtectionData(protData);
}
function check() {
if (location.protocol === 'http:' && location.hostname !== 'localhost') {
var out = 'This page has been loaded under http. This might result in the EME APIs not being available to the player and any DRM-protected content will fail to play. ' +
'If you wish to test manifest URLs that require EME support, then <a href=\'https:' + window.location.href.substring(window.location.protocol.length) + '\'>reload this page under https</a>.'
var div = document.getElementById('http-warning');
div.innerHTML = out;
div.style.display = ''
}
}
</script>
</head>
<body>
Expand All @@ -55,6 +64,13 @@
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger" role="alert" style="display: none" id="http-warning">

</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="h-100 p-5 bg-light border rounded-3">
Expand Down Expand Up @@ -85,6 +101,7 @@ <h3>DRM system priority example</h3>

<script>
document.addEventListener('DOMContentLoaded', function () {
check();
init();
});
</script>
Expand Down
21 changes: 20 additions & 1 deletion samples/drm/widevine.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
player.initialize(video, url, true);
player.setProtectionData(protData);
}

function check() {
if (location.protocol === 'http:' && location.hostname !== 'localhost') {
var out = 'This page has been loaded under http. This might result in the EME APIs not being available to the player and any DRM-protected content will fail to play. ' +
'If you wish to test manifest URLs that require EME support, then <a href=\'https:' + window.location.href.substring(window.location.protocol.length) + '\'>reload this page under https</a>.'
var div = document.getElementById('http-warning');
div.innerHTML = out;
div.style.display = ''
}
}
</script>
</head>
<body>
Expand All @@ -48,11 +58,19 @@
src="../lib/img/dashjs-logo.png"
width="200">
</header>
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger" role="alert" style="display: none" id="http-warning">

</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="h-100 p-5 bg-light border rounded-3">
<h3>Widevine DRM instantiation example</h3>
<p>This example shows how to use dash.js to play streams with Widevine DRM protection. </p><p>For a detailed explanation on DRM playback in dash.js checkout the
<p>This example shows how to use dash.js to play streams with Widevine DRM protection. </p>
<p>For a detailed explanation on DRM playback in dash.js checkout the
<a href="https://github.com/Dash-Industry-Forum/dash.js/wiki/Digital-Rights-Management-(DRM)-and-license-acquisition"
target="_blank">Wiki</a>.</p>
</div>
Expand All @@ -75,6 +93,7 @@ <h3>Widevine DRM instantiation example</h3>

<script>
document.addEventListener('DOMContentLoaded', function () {
check();
init();
});
</script>
Expand Down

0 comments on commit 0d1a4c3

Please sign in to comment.