mirror of
https://github.com/axiomatic-systems/Bento4.git
synced 2026-01-12 00:18:59 +08:00
updated test html5 player
This commit is contained in:
@@ -14,20 +14,36 @@ app.onMpdCustom = function() {
|
||||
|
||||
app.loadStream = function() {
|
||||
if (!app.player) {
|
||||
app.player = new MediaPlayer(new Dash.di.DashContext());
|
||||
app.player = new MediaPlayer(new Dash.di.DashContext());
|
||||
app.player.startup();
|
||||
app.player.attachView(document.querySelector("#videoPlayer"));
|
||||
}
|
||||
var protectionData = {
|
||||
// "org.w3.clearkey": {
|
||||
// "clearkeys": {
|
||||
// "IAAAACAAIAAgACAAAAAAAg" : "5t1CjnbMFURBou087OSj2w"
|
||||
// }
|
||||
// },
|
||||
"com.widevine.alpha": {
|
||||
"laURL": "https://widevine-proxy.appspot.com/proxy"
|
||||
}
|
||||
};
|
||||
var laUrl = document.getElementById('laUrlInput').value;
|
||||
if (laUrl) {
|
||||
protectionData['com.widevine.alpha'] = {
|
||||
'serverURL': laUrl
|
||||
}
|
||||
protectionData['com.microsoft.playready'] = {
|
||||
'serverURL': laUrl
|
||||
}
|
||||
} else {
|
||||
protectionData['com.widevine.alpha'] = {
|
||||
'serverURL': 'https://widevine-proxy.appspot.com/proxy'
|
||||
}
|
||||
}
|
||||
|
||||
var clearKey = document.getElementById('clearKeyInput').value;
|
||||
if (clearKey) {
|
||||
var clearKeys = clearKey.split(':');
|
||||
var clearKeysField = {}
|
||||
clearKeysField[clearKeys[0]] = clearKeys[1];
|
||||
protectionData['org.w3.clearkey'] = {
|
||||
'clearkeys': clearKeysField
|
||||
}
|
||||
}
|
||||
|
||||
var mediaUrl = document.getElementById('manifestUrlInput').value;
|
||||
app.player.attachSource(mediaUrl, null, protectionData);
|
||||
}
|
||||
@@ -36,4 +52,4 @@ if (document.readyState == 'complete' || document.readyState == 'interactive') {
|
||||
app.init();
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', app.init);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,16 @@
|
||||
|
||||
<tr class="dash">
|
||||
<td>
|
||||
Force Clear Key (<kid>:<key> in hex)
|
||||
License Acquisition URL (optional)
|
||||
</td>
|
||||
<td>
|
||||
<input id="laUrlInput" type="text" style="width: 98%;"></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="dash">
|
||||
<td>
|
||||
Force Clear Key (optional: <kid>:<key> in base64)
|
||||
</td>
|
||||
<td>
|
||||
<input id="clearKeyInput" type="text" style="width: 98%;"></input>
|
||||
@@ -41,7 +50,7 @@
|
||||
</table>
|
||||
<br>
|
||||
<div>
|
||||
<video id="videoPlayer"
|
||||
<video id="videoPlayer"
|
||||
width="600" height="400"
|
||||
crossorigin="anonymous"
|
||||
autoplay controls>
|
||||
@@ -49,4 +58,4 @@
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user