Unpauses the video when changing tabs on Acellus ;)
// ==UserScript==
// @name Make any Acellus Video Unpaused (Flawed)
// @namespace https://greasyfork.org/en/users/1291009
// @version 1.0
// @description Unpauses the video when changing tabs on Acellus ;)
// @author BadOrBest
// @license MIT
// @icon https://www.google.com/s2/favicons?sz=64&domain=acellus.com
// @match https://admin192c.acellus.com/student/*
// @grant none
// @grant GM_addStyle
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_deleteValue
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
// Function to unpause media elements
function unpauseMedia() {
// Select all video, audio, and Plyr elements
var mediaElements = document.querySelectorAll('video, audio, .plyr');
// Loop through each media element and unpause it
mediaElements.forEach(function(mediaElement) {
// Check if the media is paused
if (mediaElement.paused) {
// Unpause the media
mediaElement.play();
}
});
}
// Function to set aggressive unpause interval
function setUnpauseInterval() {
// Clear any existing interval
clearInterval(window.unpauseInterval);
// Set new interval
window.unpauseInterval = setInterval(unpauseMedia, 1000); // Change the interval as needed
}
// Set aggressive unpause interval initially
setUnpauseInterval();
// Event listener for tab visibility change
document.addEventListener('visibilitychange', function() {
// If tab is visible, reset the interval
if (!document.hidden) {
setUnpauseInterval();
}
});
})();