Created
April 8, 2024 10:19
-
-
Save Sneezry/27733d010ca44e9fa106c1401b4bfc05 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
// ==UserScript== | |
// @name YouTube 音量加倍 | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.youtube.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const videoList = document.getElementsByTagName('video'); | |
for (var v of videoList) { | |
// create an audio context and hook up the video element as the source | |
let audioCtx = new AudioContext(); | |
let source = audioCtx.createMediaElementSource(v); | |
// create a gain node | |
let gainNode = audioCtx.createGain(); | |
gainNode.gain.value = 10; | |
source.connect(gainNode); | |
// connect the gain node to an output destination | |
gainNode.connect(audioCtx.destination); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment