1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-02 16:08:31 +00:00
* Fixed: Disabling auto-play of channels on the front page not working. (Closes #848)
* Fixed: Automatic theater mode not working correctly when navigating between pages on Twitch. (Closes #846)
This commit is contained in:
SirStendec 2020-07-18 19:54:49 -04:00
parent 75d57c3402
commit 65a00df2a9
3 changed files with 19 additions and 10 deletions

View file

@ -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": {

View file

@ -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 )

View file

@ -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);
});
}