diff --git a/package.json b/package.json index ea3058c7..3fbbf3d2 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.20.13", + "version": "4.20.14", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/sites/twitch-twilight/modules/directory/index.jsx b/src/sites/twitch-twilight/modules/directory/index.jsx index c5f8e7f9..00965c54 100644 --- a/src/sites/twitch-twilight/modules/directory/index.jsx +++ b/src/sites/twitch-twilight/modules/directory/index.jsx @@ -336,7 +336,7 @@ export default class Directory extends SiteModule { const should_hide = (props.streamType === 'rerun' && this.settings.get('directory.hide-vodcasts')) || (props.context != null && props.context !== CARD_CONTEXTS.SingleGameList && this.settings.provider.get('directory.game.blocked-games', []).includes(game)) || - (props.sourceType === 'PROMOTION' && this.settings.get('directory.hide-promoted')); + ((props.sourceType === 'PROMOTION' || props.sourceType === 'SPONSORED') && this.settings.get('directory.hide-promoted')); let hide_container = el.closest('.tw-tower > div'); if ( ! hide_container ) diff --git a/src/sites/twitch-twilight/modules/player.jsx b/src/sites/twitch-twilight/modules/player.jsx index 1b4b14af..d112171f 100644 --- a/src/sites/twitch-twilight/modules/player.jsx +++ b/src/sites/twitch-twilight/modules/player.jsx @@ -649,7 +649,7 @@ export default class Player extends Module { cls.prototype.ffzStopAutoplay = function() { if ( t.settings.get('player.no-autoplay') || (! t.settings.get('player.home.autoplay') && t.router.current.name === 'front-page') ) - this.stopPlayer(this.props.mediaPlayerInstance, this.props.playerEvents, this); + t.stopPlayer(this.props.mediaPlayerInstance, this.props.playerEvents, this); } cls.prototype.ffzScheduleState = function() { @@ -806,11 +806,17 @@ export default class Player extends Module { inst.ffzUninstall(); }); - - this.TheatreHost.on('mount', this.tryTheatreMode, this); + this.TheatreHost.on('mount', inst => { + inst._ffz_theater_start = Date.now(); + this.tryTheatreMode(inst); + }); + this.TheatreHost.on('update', this.tryTheatreMode, this); this.TheatreHost.ready((cls, instances) => { - for(const inst of instances) + const now = Date.now(); + for(const inst of instances) { + inst._ffz_theater_start = now; this.tryTheatreMode(inst); + } }); this.PlayerSource.on('mount', this.checkCarousel, this); @@ -1505,18 +1511,21 @@ export default class Player extends Module { tryTheatreMode(inst) { if ( ! inst._ffz_theater_timer ) - inst._ffz_theater_timer = setTimeout(() => { + inst._ffz_theater_timer = requestAnimationFrame(() => { inst._ffz_theater_timer = null; if ( ! this.settings.get('player.theatre.auto-enter') || ! inst._ffz_mounted ) return; - if ( inst.props.channelHomeLive || inst.props.channelHomeCarousel ) + if ( inst.props.channelHomeLive || inst.props.channelHomeCarousel || inst.props.theatreModeEnabled ) return; - if ( inst?.props?.onTheatreModeEnabled ) + if ( Date.now() - (inst._ffz_theater_start ||0) > 2000 ) + return; + + if ( inst.props.onTheatreModeEnabled ) inst.props.onTheatreModeEnabled(); - }, 250); + }); }