Skip to content

Instantly share code, notes, and snippets.

@jamengual
Forked from davenicoll/acc.js
Created July 3, 2025 20:18
Show Gist options
  • Save jamengual/13b7f5f4c95188c309f1123332fe94ce to your computer and use it in GitHub Desktop.
Save jamengual/13b7f5f4c95188c309f1123332fe94ce to your computer and use it in GitHub Desktop.
Workday training accelerator
// Storyline-Compatible Video Skipper
(function() {
'use strict';
function debugLog(message, data = null) {
console.log(`[STORYLINE SKIPPER] ${message}`, data || '');
}
// Function to skip video using Storyline-compatible methods
function skipCurrentVideo() {
debugLog('๐ŸŽฏ ATTEMPTING STORYLINE-COMPATIBLE SKIP');
const videos = document.querySelectorAll('video');
let success = false;
videos.forEach((video, index) => {
if (video.duration > 1 && video.videoWidth > 0 && !video.ended) {
debugLog(`๐Ÿ“น Processing video: ${video.duration.toFixed(2)}s`);
try {
// Method 1: Fast forward with natural playback
video.playbackRate = 32; // Very fast but still "playing"
video.muted = true; // Mute for fast forward
if (video.paused) {
video.play();
}
debugLog(`๐Ÿš€ Set video to 32x speed (muted)`);
// Method 2: Let it play naturally but fast, then trigger end
setTimeout(() => {
video.currentTime = video.duration - 0.1;
debugLog(`โญ๏ธ Jumped to near end: ${video.currentTime.toFixed(2)}s`);
}, 500);
// Method 3: Fire multiple completion events
setTimeout(() => {
video.currentTime = video.duration;
// Fire all possible completion events
const events = ['timeupdate', 'progress', 'ended', 'canplaythrough'];
events.forEach(eventType => {
video.dispatchEvent(new Event(eventType, { bubbles: true }));
});
debugLog(`๐ŸŽŠ Fired completion events`);
}, 1000);
success = true;
} catch (error) {
debugLog(`โŒ Error: ${error.message}`);
}
}
});
return success;
}
// Alternative: Try to find and trigger Storyline's built-in controls
function useStorylineControls() {
debugLog('๐ŸŽฎ LOOKING FOR STORYLINE VIDEO CONTROLS');
// Look for Storyline's video control elements
const possibleControls = [
// Common Storyline video control selectors
'.video-controls .seek-bar',
'.progress-bar',
'.timeline',
'[role="slider"]',
'.scrubber',
'input[type="range"]'
];
let found = false;
possibleControls.forEach(selector => {
const controls = document.querySelectorAll(selector);
controls.forEach(control => {
try {
if (control.max && control.max > 10) { // Likely a video timeline
control.value = control.max; // Set to end
// Trigger input events
['input', 'change', 'mouseup'].forEach(eventType => {
control.dispatchEvent(new Event(eventType, { bubbles: true }));
});
debugLog(`๐ŸŽ›๏ธ Moved timeline control to end`);
found = true;
}
} catch (e) {}
});
});
return found;
}
// Combined skip function
function comprehensiveSkip() {
debugLog('๐Ÿ”ฅ COMPREHENSIVE VIDEO SKIP STARTING');
let success = false;
// Try video element manipulation
success = skipCurrentVideo() || success;
// Try Storyline control manipulation
setTimeout(() => {
useStorylineControls();
}, 200);
// Try clicking any visible video elements to advance
setTimeout(() => {
const videoElements = document.querySelectorAll('video');
videoElements.forEach(video => {
if (video.offsetWidth > 0 && video.offsetHeight > 0) {
// Click the video element itself
video.click();
debugLog(`๐Ÿ‘† Clicked video element`);
}
});
}, 400);
return success;
}
// Create enhanced control panel
const controlPanel = document.createElement('div');
controlPanel.style.cssText = `
position: fixed;
top: 10px;
right: 10px;
z-index: 99999;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 20px;
border-radius: 15px;
font-family: Arial, sans-serif;
font-size: 14px;
min-width: 250px;
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
`;
controlPanel.innerHTML = `
<div style="margin-bottom: 15px; font-weight: bold; font-size: 16px;">๐ŸŽฌ STORYLINE VIDEO SKIPPER</div>
<button id="comprehensive-skip" style="width: 100%; padding: 12px; background: #ff4444; color: white; border: none; border-radius: 8px; cursor: pointer; margin-bottom: 10px; font-weight: bold; font-size: 14px;">๐Ÿš€ SKIP VIDEO NOW</button>
<button id="speed-only" style="width: 100%; padding: 8px; background: #44ff44; color: black; border: none; border-radius: 5px; cursor: pointer; margin-bottom: 10px;">โšก 32x SPEED ONLY</button>
<div style="font-size: 12px; color: #ddd; text-align: center;">
๐Ÿ”ฅ Comprehensive skip<br>
โšก Speed boost only<br>
Press 'Q' for quick skip
</div>
`;
document.body.appendChild(controlPanel);
// Event listeners
document.getElementById('comprehensive-skip').addEventListener('click', comprehensiveSkip);
document.getElementById('speed-only').addEventListener('click', () => {
const videos = document.querySelectorAll('video');
videos.forEach(video => {
if (video.duration > 1 && video.videoWidth > 0) {
video.playbackRate = 32;
video.muted = true;
if (video.paused) video.play();
debugLog(`โšก Set video to 32x speed`);
}
});
});
// Keyboard shortcut
document.addEventListener('keydown', (e) => {
if (e.key.toLowerCase() === 'q' && !e.target.matches('input, textarea')) {
e.preventDefault();
comprehensiveSkip();
}
});
debugLog('๐ŸŽฏ Storyline Video Skipper loaded');
debugLog('๐Ÿ”ฅ Try "SKIP VIDEO NOW" for comprehensive skip');
debugLog('โšก Try "32x SPEED ONLY" to just speed up');
debugLog('โŒจ๏ธ Press "Q" for quick comprehensive skip');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment