Facebook Volume

Video Volume default to 0.10 every 2 seconds

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Facebook Volume
// @namespace   https://www.facebook.com/
// @version     0.1
// @description Video Volume default to 0.10 every 2 seconds
// @match       https://www.facebook.com/*
// @copyright   2012+, Me
// @grant       none
// ==/UserScript==

var VolumeIDList = [];
var VolumeDefault = 0.30;    // 這裏設定音量大小

setTimeout(FindAndSetVolumes, 2000);

function FindAndSetVolumes() {
var VideoPlayerList = document.getElementsByTagName("video");
var Len = VideoPlayerList.length;
var def_this_run = 0;
for(var i=0;i<Len;i++) {
if( VolumeIDList[VideoPlayerList[i].id] === undefined ) {
VolumeIDList[VideoPlayerList[i].id] = true;
VideoPlayerList[i].volume = VolumeDefault;
def_this_run++;
}
}
var d = new Date();
console.log(d+" - Defaulted: "+def_this_run);

setTimeout(FindAndSetVolumes, 2000);
}