Skip to content

Instantly share code, notes, and snippets.

View sb2702's full-sized avatar

Sam Bhattacharyya sb2702

View GitHub Profile
@sb2702
sb2702 / test.js
Created February 11, 2021 20:06
First Test
console.log("Hello world");
@sb2702
sb2702 / index.html
Last active March 4, 2021 18:38
Basic Upscaling Example
<head>
<script src="video.js"></script>
<script src="vectorly-videojs.js"> </script>
</head>
<body>
<video id="my-video" class="video-js" data-setup="{}" src="video.mp4" />
<script>
videojs.registerPlugin('vectorlyPlugin', vectorlyUpscaler.videoJSPlugin);
@sb2702
sb2702 / models.js
Created February 11, 2021 21:58
Importing new models
$.getJSON('screencasts.json', function(json) {
videojs.registerPlugin('vectorlyPlugin', vectorly.videoJSPlugin);
const player = videojs('my-video');
player.vectorlyPlugin({width: 1280, height: 720, model: json}); // Upscale to 720p (from 240p)
});
<head>
<link href="https://vjs.zencdn.net/7.10.2/video-js.css" rel="stylesheet" />
<script src="https://vjs.zencdn.net/7.10.2/video.min.js"></script>
<script src="https://cdn.vectorly.io/upscaler/latest/vectorly-videojs.js"></script>
</head>
<body>
<video id="my-video" class="video-js" controls width="1280" height="720" data-setup="{}" crossorigin="anonymous">
<head>
<link href="video-js.css" rel="stylesheet" />
<script src="video.min.js"></script>
<script src="vectorly-videojs.js"></script>
</head>
<body>
<video id="my-video" width="1280" height="720" class="video-js" controls data-setup="{}" >
<source src="video.mp4" type="video/mp4" />
<head>
<script src="https://cdn.jwplayer.com/libraries/[your-jwplayer-version].js"></script>
</head>
<body>
<div id="myElement"></div>
<script>
jwplayer("myElement").setup({
"playlist": [{
@sb2702
sb2702 / shaka-player-upscaling.html
Last active February 26, 2021 19:01
Shaka Player Upscaling Integration
<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>
@sb2702
sb2702 / upscaling-demo.js
Last active March 30, 2021 03:25
Standalone javascript upscaling plugin
const config = {
token: '...'
};
const video = document.getElementById("video");
const upscaler = new vectorlyUpscaler(video, config);
const upscaler = new vectorlyUpscaler(video, config);
upscaler.on('load', function () {
console.log("Upscaler initialized");
});
upscaler.on('start', function () {
console.log("Starting upscaling");
});
// Enabled by default
const upscaler = new vectorlyUpscaler(video, config);
upscaler.disable();
upscaler.enable();