-
Notifications
You must be signed in to change notification settings - Fork 3
/
debug-ffz-twitch-compressor.user.js
48 lines (43 loc) · 1.65 KB
/
debug-ffz-twitch-compressor.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// ==UserScript==
// @name Debug FFZ Twitch compressor
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description try to take over the world!
// @author You
// @match https://www.twitch.tv/videos/*
// @icon https://icons.duckduckgo.com/ip2/twitch.tv.ico
// @require https://greasyfork.org/scripts/419640-onelementready/code/onElementReady.js?version=887637
// @grant none
// ==/UserScript==
/* global onElementReady */
/**
* print DynamicsCompressorNode debug info to console on a 1s interval
*
* @param {FFZHTMLVideoElement} video - html video node
* @returns {void}
*/
function addLogging(video) {
console.log("video element found, adding logging")
// check every second to see if the compressor node is present
const interval = setInterval(() => {
const compressor = video?._ffz_compressor
if (compressor) {
console.log("compressor found, logging basic info once")
console.log("threshold", compressor.threshold)
console.log("knee", compressor.knee)
console.log("ratio", compressor.ratio)
console.log("attack", compressor.attack)
console.log("release", compressor.release)
clearInterval(interval)
// log compressor info every second
setInterval(() => {
console.log("reduction", compressor.reduction)
}, 1000)
}
}, 1000)
// video.addEventListener("ended", () => {
// clearInterval(interval)
// })
}
// also can be found here `ffz.__modules["site.player"].Player.instances.values().next().value.props.mediaPlayerInstance.core.mediaSinkManager.video._ffz_compressor`
onElementReady(`video`, { findOnce: true }, addLogging)