diff --git a/package.json b/package.json index 20bb872c..8f75c8eb 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.19.8", + "version": "4.19.9", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx index 3a57fadd..3c8c5e63 100644 --- a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx +++ b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx @@ -1292,13 +1292,32 @@ export default class EmoteMenu extends Module { if ( a.locked && ! b.locked ) return 1; if ( sort_tiers || a.locked || b.locked ) { - if ( COLLATOR ) { - const result = COLLATOR.compare(a.set_id, b.set_id); - if ( result != 0 ) - return result; + if ( a.bits || b.bits ) { + if ( ! b.bits ) + return 1; + else if ( ! a.bits ) + return -1; + + const a_val = a.bit_value || 0, + b_val = b.bit_value || 0; + + if ( COLLATOR ) { + const result = COLLATOR.compare(a_val, b_val); + if ( result != 0 ) + return result; + } else { + if ( a_val < b_val ) return -1; + if ( a_val > b_val ) return 1; + } } else { - if ( a.set_id < b.set_id ) return -1; - if ( a.set_id > b.set_id ) return 1; + if ( COLLATOR ) { + const result = COLLATOR.compare(a.set_id, b.set_id); + if ( result != 0 ) + return result; + } else { + if ( a.set_id < b.set_id ) return -1; + if ( a.set_id > b.set_id ) return 1; + } } } @@ -1332,7 +1351,8 @@ export default class EmoteMenu extends Module { is_bits = parseInt(emote_set.id, 10) > 5e8, is_points = TWITCH_POINTS_SETS.includes(int_id) || owner?.login === 'channel_points', chan = is_points ? null : owner, - set_data = data[set_id]; + set_data = data[set_id], + is_current_bits = is_bits && owner && owner.id == props?.channel_data?.user?.id; /*if ( chan ) t.emotes.setTwitchSetChannel(set_id, { @@ -1486,6 +1506,7 @@ export default class EmoteMenu extends Module { srcSet, overridden: overridden ? mapped.id : null, misc: ! chan, + bits: is_bits, favorite: is_fav }; @@ -1494,7 +1515,7 @@ export default class EmoteMenu extends Module { emotes.push(em); - if ( is_bits ) + if ( is_current_bits ) bits_unlocked.push(em); if ( is_fav && ! twitch_seen.has(id) ) @@ -1640,6 +1661,8 @@ export default class EmoteMenu extends Module { locked, src: `${base}/1.0`, srcSet: `${base}/1.0 1x, ${base}/2.0 2x`, + bits: true, + bit_value: summary.threshold, favorite: is_fav }; diff --git a/src/sites/twitch-twilight/modules/player.jsx b/src/sites/twitch-twilight/modules/player.jsx index 73e2cb36..412f84f8 100644 --- a/src/sites/twitch-twilight/modules/player.jsx +++ b/src/sites/twitch-twilight/modules/player.jsx @@ -1397,11 +1397,17 @@ export default class Player extends Module { const video = player.mediaSinkManager?.video; if ( video?._ffz_compressor && player.attachHTMLVideoElement ) { - const new_vid = createElement('video'); - new_vid.volume = player.getVolume(); + const new_vid = createElement('video'), + vol = player.getVolume(), + muted = player.isMuted(); + new_vid.volume = muted ? 0 : vol; new_vid.playsInline = true; video.replaceWith(new_vid); player.attachHTMLVideoElement(new_vid); + setTimeout(() => { + player.setVolume(vol); + player.setMuted(muted); + }, 0); } this.PlayerSource.check();