Last active
May 6, 2023 06:24
-
-
Save emindeniz99/9638abc6ad06523b47c27aec1ca843b5 to your computer and use it in GitHub Desktop.
panopto video speed
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
// ==UserScript== | |
// @name panopto video speed | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://boun.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=* | |
// @icon https://www.google.com/s2/favicons?domain=panopto.eu | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const speedAdd=(speed=3)=>{ | |
const superfast =document.querySelector("#Fastest").cloneNode(true); | |
superfast.onclick=()=>{document.getElementsByTagName("video").primaryVideo.playbackRate=speed; | |
document.querySelector("#playSpeedMultiplier").innerText=`${speed}x`; | |
}; | |
superfast.innerText=`${speed}`; | |
superfast.id="ssuper"; | |
document.querySelector("#playSpeedExpander").insertBefore(superfast,document.querySelector("#playSpeedExpander .flyout-close")) | |
} | |
// set up the mutation observer | |
var h1observer = new MutationObserver(function (mutations, me) { | |
// mutations is an array of mutations that occurred | |
// me is the MutationObserver instance | |
var canvas = document.querySelector("#Fastest"); | |
if (canvas) { | |
speedAdd(2.25); | |
speedAdd(2.5); | |
speedAdd(2.75); | |
speedAdd(3); | |
speedAdd(3.25); | |
speedAdd(3.5); | |
speedAdd(4); | |
speedAdd(16); | |
me.disconnect(); // stop observing | |
return; | |
} | |
}); | |
// start observing | |
h1observer.observe(document, { | |
childList: true, | |
subtree: true, | |
}); | |
// Your code here... | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
install tampermonkey
https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo
click this link and install the script
https://gist.github.com/emindeniz99/9638abc6ad06523b47c27aec1ca843b5/raw/panopto-tampermonkey.user.js