1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00
* Fixed: Scrolling to adjust volume not falling back to built-in volume when gain control is bound to the same input but not currently enabled.
* Fixed: Badges not appearing correctly in Firefox with high-DPI displays or page zoom.
This commit is contained in:
SirStendec 2021-04-25 13:11:28 -04:00
parent b3c3c8130d
commit 2f41f520af
3 changed files with 23 additions and 18 deletions

View file

@ -1,7 +1,7 @@
{
"name": "frankerfacez",
"author": "Dan Salvato LLC",
"version": "4.21.0",
"version": "4.21.1",
"description": "FrankerFaceZ is a Twitch enhancement suite.",
"private": true,
"license": "Apache-2.0",

View file

@ -133,6 +133,9 @@ export function generateBadgeCSS(badge, version, data, style, is_dark, badge_ver
if ( data.urls && scale === 1 ) {
image_set = `${WEBKIT}image-set(${image} 1x${data.urls[2] ? `, url("${data.urls[2]}") 2x` : ''}${data.urls[4] ? `, url("${data.urls[4]}") 4x` : ''})`
} else if ( data.urls && scale === 2 ) {
image_set = `${WEBKIT}image-set(${image} 1x${data.urls[4] ? `, url("${data.urls[4]}") 2x` : ''})`;
} else if ( ! svg && scale < 4 ) {
if ( scale === 1 )
image_set = `${WEBKIT}image-set(${image} 1x, url("${base_image}2${trans ? '_trans' : ''}.png") 2x, url("${base_image}4${trans ? '_trans' : ''}.png") 4x)`;

View file

@ -877,36 +877,26 @@ export default class PlayerBase extends Module {
gain_scroll = t.settings.get('player.gain.scroll'),
matches_gain = gain_scroll && matchesEvent(gain_scroll, event, this.ffz_rmb),
matches_vol = ! matches_gain && vol_scroll && matchesEvent(vol_scroll, event, this.ffz_rmb);
matches_vol = vol_scroll && matchesEvent(vol_scroll, event, this.ffz_rmb);
if ( ! matches_gain && ! matches_vol )
return;
const delta = event.wheelDelta || -(event.deltaY || event.detail || 0),
player = this.props?.mediaPlayerInstance,
video = player?.mediaSinkManager?.video || player?.core?.mediaSinkManager?.video;
video = player?.mediaSinkManager?.video || player?.core?.mediaSinkManager?.video,
has_gain = video?._ffz_compressed && video?._ffz_gain != null,
doing_gain = has_gain && matches_gain;
if ( ! player?.getVolume || (matches_gain && ! video) )
if ( ! player?.getVolume )
return;
if ( matches_gain ? wantsRMB(gain_scroll) : wantsRMB(vol_scroll) )
if ( doing_gain ? wantsRMB(gain_scroll) : wantsRMB(vol_scroll) )
this.ffz_scrolled = true;
const amount = t.settings.get('player.volume-scroll-steps');
if ( matches_vol && ! (video._ffz_compressed && t.settings.get('player.gain.no-volume')) ) {
const old_volume = video?.volume ?? player.getVolume(),
volume = Math.max(0, Math.min(1, old_volume + (delta > 0 ? amount : -amount)));
player.setVolume(volume);
localStorage.volume = volume;
if ( volume !== 0 ) {
player.setMuted(false);
localStorage.setItem('video-muted', JSON.stringify({default: false}));
}
} else if ( matches_gain ) {
if ( doing_gain ) {
let value = video._ffz_gain_value;
if ( value == null )
value = t.settings.get('player.gain.default');
@ -926,6 +916,18 @@ export default class PlayerBase extends Module {
video._ffz_gain_value = value;
t.updateGain(this);
} else if ( matches_vol && ! (video._ffz_compressed && t.settings.get('player.gain.no-volume')) ) {
const old_volume = video?.volume ?? player.getVolume(),
volume = Math.max(0, Math.min(1, old_volume + (delta > 0 ? amount : -amount)));
player.setVolume(volume);
localStorage.volume = volume;
if ( volume !== 0 ) {
player.setMuted(false);
localStorage.setItem('video-muted', JSON.stringify({default: false}));
}
}
event.preventDefault();