Last active
May 4, 2020 22:47
-
-
Save rdp/93c761b3524529e591e5286073545362 to your computer and use it in GitHub Desktop.
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
// attempt to fidn the first <video ... tag on the page: | |
function findFirstVideoTag() { | |
var all = document.getElementsByTagName("video"); | |
if (all.length > 0) | |
return all[0]; | |
else { | |
// iframes | |
var i, frames; | |
frames = document.getElementsByTagName("iframe"); | |
for (i = 0; i < frames.length; ++i) { | |
try { var childDocument = frame.contentDocument } catch (e) { continue }; // skip ones we can't access :| | |
all = frames[i].contentDocument.document.getElementsByTagName("video"); | |
if (all.length > 1) | |
return all[0]; | |
} | |
return null; | |
} | |
} | |
video_element = findFirstVideoTag(); | |
video_element.playbackRate = 3; // triple speed it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
with amazon [google chrome OS X] to seek somewhere: b.pause(); b.currentTime = 3; // resumes playback at second 3
play() and pause() maybe after a seek or some thing? sometimes pause() after a seek makes it work?