apply audio equalizer to videos too

This commit is contained in:
ed 2024-04-06 18:44:08 +00:00
parent d94b5b3fc9
commit 7744226b5c
2 changed files with 10 additions and 4 deletions

View file

@ -720,6 +720,9 @@ window.baguetteBox = (function () {
figure.appendChild(image); figure.appendChild(image);
if (is_vid && window.afilt)
afilt.apply(undefined, image);
if (options.async && callback) if (options.async && callback)
callback(); callback();
} }

View file

@ -2734,7 +2734,7 @@ var afilt = (function () {
mp.acs = mpo.acs = null; mp.acs = mpo.acs = null;
}; };
r.apply = function (v) { r.apply = function (v, au) {
r.init(); r.init();
r.draw(); r.draw();
@ -2754,12 +2754,13 @@ var afilt = (function () {
if (r.plugs[a].en) if (r.plugs[a].en)
plug = true; plug = true;
if (!actx || !mp.au || (!r.eqen && !plug && !mp.acs)) au = au || (mp && mp.au);
if (!actx || !au || (!r.eqen && !plug && !mp.acs))
return; return;
r.stop(); r.stop();
mp.au.id = mp.au.id || Date.now(); au.id = au.id || Date.now();
mp.acs = r.acst[mp.au.id] = r.acst[mp.au.id] || actx.createMediaElementSource(mp.au); mp.acs = r.acst[au.id] = r.acst[au.id] || actx.createMediaElementSource(au);
if (r.eqen) if (r.eqen)
add_eq(); add_eq();
@ -4928,6 +4929,8 @@ var thegrid = (function () {
}; };
r.onhide = function () { r.onhide = function () {
afilt.apply();
if (!thegrid.ihop) if (!thegrid.ihop)
return; return;