-
-
Save jamengual/13b7f5f4c95188c309f1123332fe94ce to your computer and use it in GitHub Desktop.
Workday training accelerator
This file contains hidden or 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
// 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