Create a gist now

Instantly share code, notes, and snippets.

Embed
Speed up the Wistia player automatically.
{
"name": "Wistia auto-speed",
"version": "1.0",
"description": "Automatically speed up Wistia embeds to 1.5x, and select the best quality.",
"content_scripts": [
{
"matches": [
"*://*.wistia.com/medias/*",
"*://fast.wistia.net/embed/iframe/*"
],
"js": ["wistia.js"],
"run_at": "document_end",
"all_frames": true
}
],
"manifest_version": 2
}
var speed = "1.5x";
var timer1 = setInterval(function() {
var button = document.querySelector(`button[title='${speed}']`);
if (button) {
console.log(`Playback speed to ${speed}.`);
clearInterval(timer1);
button.click();
}
}, 1000);
var timer2 = setInterval(function() {
var button = document.querySelector(`button[title='1080p']`) || document.querySelector(`button[title='720p']`);
if (button) {
console.log(`Playback quality to ${button.title}.`);
clearInterval(timer2);
button.click();
}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment