betterttv icon indicating copy to clipboard operation
betterttv copied to clipboard

Add a setting to prevent twitch from automatically lowering stream quality when it's lost focus

Open janjak2 opened this issue 4 years ago • 7 comments

It's already annoying when it works, you open a new tab to search for a thing then you come back on twitch and have to wait few seconds of 160p, but it is even more when it doesn't and freezes the stream instead of getting back to the initial quality.

janjak2 avatar Jul 24 '19 14:07 janjak2

I suspect it's a security risk that browsers allow websites to detect focus, so at some point this will be exploited and then blocked in response.

However, as things stand, I completely agree. It's very annoying when Twitch degrades/pauses/crashes because it does a poor job of reacting to focus. I have reported a bug to this effect to Twitch previously. Upvoted.

ghost avatar Jan 05 '20 17:01 ghost

@night

This is my first time using BTTV and I loved it. Thanks for putting this addon together.

One thing that I am missing is the option to 'lock' the stream quality when changing tabs as described in this ticket. I've been using the script below for at least a year and it has worked fine me:

javascript: Object.defineProperty(document, "hidden", {
    value: !1,
    writable: !1
}), Object.defineProperty(document, "visibilityState", {
    value: "visible",
    writable: !1
}), Object.defineProperty(document, "webkitVisibilityState", {
    value: "visible",
    writable: !1
}), document.dispatchEvent(new Event("visibilitychange")), document.hasFocus = function() {
    return !0
}, window.localStorage.setItem("video-quality", '{"default":"chunked"}')

The way that I have currently setup is I added this code as a bookmark on my Chrome browser. As soon as I open the stream, I ensure that it is on 1080p (or the highest quality available) and I click on the bookmark button to run it. After this, changing tabs won't change the stream quality anymore.

Hopefully it is possible to integrate this on BTTV.

I am not the author of this script I think I found it a long time ago on reddit.

newacc12 avatar Nov 11 '20 01:11 newacc12

A year and a half and still nothing!

Feky avatar Dec 20 '20 06:12 Feky

Agree with all of the above, and upvoted.. if it makes a difference. I want this too! Twitch's automatic quality switching is trash and needs to be overridden.

AcesFullOfKings avatar Feb 25 '21 21:02 AcesFullOfKings

Agree with all of the above, and upvoted.. if it makes a difference. I want this too! Twitch's automatic quality switching is trash and needs to be overridden.

I'm using this script for tampermonkey and it's working just fine but it's sad they didn't implant this simple script. https://greasyfork.org/en/scripts/383093-twitch-disable-automatic-video-downscale

Feky avatar Feb 25 '21 22:02 Feky

I created a bookmark with the code suggested by @newacc12 and it seems to work great, but I do have to manually run it. If I get tired of running it manually I'll have a look into the TM option.. however it'd be nice if I didnt have to install another extension to modify twitch when I have one which already modifies twitch..

AcesFullOfKings avatar Feb 26 '21 16:02 AcesFullOfKings

No news other than the script that it works. ?

THEDARKK avatar Nov 27 '21 12:11 THEDARKK

This used to be problematic but Twitch seems to have finally fixed the quality reduction from breaking the stream continuity. I don't think this is worth doing any longer, as the bandwidth reduction is better for everyone involved.

night avatar Dec 27 '22 01:12 night

Yeah, good thing you waited for this for 3 years to fix it by itself.

Feky avatar Jan 26 '23 06:01 Feky

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related issues or feature requests.

github-actions[bot] avatar Apr 26 '23 09:04 github-actions[bot]