<
html xmlns="http://www.w3.org/1999/xhtml">
<body style="margin:0;padding:0;background-color:0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.3.0/shaka-player.compiled.js"></script>
<div id="videodiv" style="position:absolute;width:100%;height:100%;z-index=0">
<video width=100% height=100% id="video" autoplay></video>
</div>
<script>
async function loadMedia(FileName, Widevine) {
try {
window.player.configure({
drm: {
servers: {
"
com.widevine.alpha": Widevine,
},
advanced: {
"
com.widevine.alpha": {
"videoRobustness": "SW_SECURE_CRYPTO",
"audioRobustness": "SW_SECURE_CRYPTO",
}
},
},
});
window.player.configure("manifest.dash.ignoreMinBufferTime", true);
window.player.configure("streaming.rebufferingGoal", 1);
window.player.configure({
manifest: {
dash: {
ignoreMinBufferTime: true
}
},
streaming: {
rebufferingGoal: 1,
}
});
await window.player.load(FileName);
} catch (e) {
onError(e);
}
}
function initApp() {
shaka.polyfill.installAll();
if (shaka.Player.isBrowserSupported()) {
initPlayer();
} else {
console.error("Browser not supported!");
}
}
async function initPlayer() {
const video = document.getElementById("video");
const player = new shaka.Player(video);
video.onloadeddata = function() {
setTimeout(function() {
video.muted = false;
video.play()
}, 250);
};
window.player = player;
player.addEventListener("error", onErrorEvent);
}
function onErrorEvent(event) {
onError(event.detail);
}
function onError(error) {
console.error("Error code", error.code, "object", error);
}
document.addEventListener("DOMContentLoaded", initApp);
</script>
</body>
</
html>