Last active
December 15, 2022 17:45
-
-
Save amit-g/97b25b800136e70f2bef6d643f67e36e to your computer and use it in GitHub Desktop.
Increrase video playback speed on microsoft stream
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 Increase Playback Speed on Microsoft Stream | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://*.sharepoint.com/sites/*/stream.aspx?* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
async function increasePlaybackRate(){ | |
const later = (delay, value) => new Promise(resolve => setTimeout(resolve, delay, value)); | |
later(1000, "Player Speed Increase") | |
.then(msg => { | |
console.log(msg); | |
var player = document.querySelector('video'); | |
if (player) { | |
/* play video twice as fast */ | |
document.querySelector('video').defaultPlaybackRate = 2.0; | |
document.querySelector('video').playbackRate = 2.0; | |
console.log("Player speed set to 2.0"); | |
} | |
else { | |
console.log("Could not locate videq element"); | |
} | |
}) | |
.catch(() => { console.log("Cancelled"); }); | |
} | |
increasePlaybackRate(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment