-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WiP: Refactor content protection * Refactor some functions in StreamController.js * Refactored the DRM workflow * Fix a bug when registering events in the ProtectionController.js * Rename variables in ProtectionController.js * Do not call requestKeySystemAccess when creating a new session with an existing key system * Clear all mediaInfos in ProtectionController when MPD is updated * Import FactoryMaker in ProtectionController.js * Fix unit tests for Protection * Adjust index.d.ts * Add missing JSDoc for ProtectionController.js * Add support for dashif:laurl
- Loading branch information
Showing
26 changed files
with
1,114 additions
and
787 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
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,95 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>License server via MPD example</title> | ||
|
||
<script src="../../dist/dash.all.debug.js"></script> | ||
|
||
<!-- Bootstrap core CSS --> | ||
<link href="../lib/bootstrap/bootstrap.min.css" rel="stylesheet"> | ||
<link href="../lib/main.css" rel="stylesheet"> | ||
|
||
<style> | ||
video { | ||
width: 640px; | ||
height: 360px; | ||
} | ||
</style> | ||
|
||
<script class="code"> | ||
function init() { | ||
var protData = { | ||
"com.widevine.alpha": { | ||
"httpRequestHeaders": { | ||
"X-AxDRM-Message": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU" | ||
}, | ||
priority: 0 | ||
}, | ||
"com.microsoft.playready": { | ||
"httpRequestHeaders": { | ||
"X-AxDRM-Message": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU" | ||
}, | ||
priority: 0 | ||
} | ||
}; | ||
var video, | ||
player, | ||
url = "mpds/laurl.mpd"; | ||
|
||
video = document.querySelector("video"); | ||
player = dashjs.MediaPlayer().create(); | ||
player.updateSettings({ | ||
debug: { | ||
logLevel: 5 | ||
} | ||
}) | ||
player.initialize(video, url, true); | ||
player.setProtectionData(protData); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
|
||
<main> | ||
<div class="container py-4"> | ||
<header class="pb-3 mb-4 border-bottom"> | ||
<img class="" | ||
src="../lib/img/dashjs-logo.png" | ||
width="200"> | ||
</header> | ||
<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 specify the license server url as part of the MPD using | ||
'dashif:laurl'. </p> | ||
<p>For a detailed explanation on this checkout the | ||
<a href="https://github.com/Dash-Industry-Forum/dash.js/wiki/Digital-Rights-Management-(DRM)-and-license-acquisition#licenser-server-url-via-mpd" | ||
target="_blank">Wiki</a>.</p> | ||
</div> | ||
</div> | ||
<div class="col-md-8"> | ||
<video controls="true"></video> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div id="code-output"></div> | ||
</div> | ||
</div> | ||
<footer class="pt-3 mt-4 text-muted border-top"> | ||
© DASH-IF | ||
</footer> | ||
</div> | ||
</main> | ||
|
||
|
||
<script> | ||
document.addEventListener('DOMContentLoaded', function () { | ||
init(); | ||
}); | ||
</script> | ||
<script src="../highlighter.js"></script> | ||
</body> | ||
</html> |
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
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
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
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
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
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
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
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
Oops, something went wrong.