Last active
February 26, 2021 19:01
-
-
Save sb2702/2049c691948c01b5aa35ff9cd2d887a7 to your computer and use it in GitHub Desktop.
Shaka Player Upscaling Integration
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
<head lang="en"> | |
<script src="shaka-player.ui.js"></script> | |
<link rel="stylesheet" href="controls.css"> | |
<script src="vectorly-shaka.js"></script> | |
</head> | |
<body> | |
<div id="container" data-shaka-player-container style="max-width:1280px;"> | |
<video data-shaka-player crossorigin="anonymous" id="video" ></video> | |
</div> | |
<script> | |
const url = "video.mp4"; | |
async function init() { | |
// When using the UI, the player is made automatically by the UI object. | |
const video = document.getElementById('video'); | |
const ui = video['ui']; | |
const controls = ui.getControls(); | |
const player = controls.getPlayer(); | |
try { | |
await player.load(url); | |
// This runs if the asynchronous load is successful. | |
const upscaler = new vectorlyUpscaler.shakaPlugin(player, {width: 1280, height: 720}); | |
} catch (error) { | |
console.log(error); | |
} | |
} | |
document.addEventListener('shaka-ui-loaded', init); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment