Newer
Older
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
// ==UserScript==
// @name BBB Volume Slider
// @website https://code.fbi.h-da.de/istddmue2/bbb-volume-slider-userscript
// @version 0.1
// @description Adds a volume slider
// @author Daniel Müller
// @match https://*.h-da.de/html5client/join*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Check if the volume slider exists
if (document.getElementById("vs-container") != null) return;
// Create the container
let vsc = document.createElement("div")
vsc.id = "vs-container"
vsc.style.position = "absolute"
vsc.style.top = "20px"
vsc.style.right = "75px"
// Create the actual slider
let vs = document.createElement("input")
vs.type = "range"
vs.min = 1
vs.max = 100
vs.value = 100
vs.oninput = function() {
document.getElementById("remote-media").volume = Math.pow(this.value / 100.0, 2)
}
vsc.append(vs)
document.body.appendChild(vsc)
})();