Making teachable videos faster
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 2024-07-30
// @description try to take over the world!
// @author You
// @match https://pro.academind.com/courses/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=academind.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
function replaceVideo()
{
let video = document.createElement("video")
video.src = document.querySelector('a.download').href
video.width = 800
document.querySelector('.lecture-attachment-type-video').replaceWith(video)
video.play()
video.preload = "auto"
video.controls = true
}
try {
setInterval(() => {
if (document.querySelector('.lecture-attachment-type-video')?.children.length > 1) {
replaceVideo();
}
}, 1000)
} catch (e) {
}
})();