Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vaft issues (freezing / paused / playback problems) #164

Open
TsukiZero opened this issue Jun 15, 2023 · 17 comments
Open

vaft issues (freezing / paused / playback problems) #164

TsukiZero opened this issue Jun 15, 2023 · 17 comments

Comments

@TsukiZero
Copy link

They might be tied to ads, but sometimes the video freeze and the audio keeps going, when this happens the quality changes from whatever it was to 360p for a moment or until the player is reset.

With "Video Swap New" it causes the quality to change completely from whatever to 360p but the frames stops freezing.

@MonfGeiger
Copy link

I can confirm this. im currently watching a live LaynaLazar stream right now at the time of this comment, and i can confirm random frame freezes, on top of a video quality issue and a total video freeze

@TsukiZero
Copy link
Author

This issue still persists in the new build.

@pixeltris
Copy link
Owner

Correct. I'm not working on fixes for the freezing issues.

@TsukiZero
Copy link
Author

No idea on solutions either?

@Zero3K
Copy link

Zero3K commented Sep 5, 2023

Any updates?

@TsukiZero
Copy link
Author

No fix yet, no one looking into it apparently.

@izar3
Copy link

izar3 commented Feb 24, 2024

This has something to do with bad connection when ads start. It does not happen if your connection is stable and have low latency

I have tested this while an ad is playing, dropping my connection in and out and it will always swap to source > 360p > source > Freeze

My testing on #222 findReactNode() was broken and lead to incorrect results but if you remove this function in the latest build there is no freezing during ads even if your connection is unstable

so.. is there a way to change the alt player/m3u8 when ads are showing to 720p or source quality or another solution?

@pixeltris
Copy link
Owner

pixeltris commented Feb 24, 2024

Under vaft every time the Twitch player requests the m3u8 it requests 3 different m3u8 player types. The first two have source quality. The last doesn't. This is already pretty aggressive at trying to get the source quality. If you'd like to be more aggressive you could add a fourth request.

weaverText = await processM3U8(url, responseText, realFetch, PlayerType2);
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType3);
}

Replace with:

weaverText = await processM3U8(url, responseText, realFetch, 'site');
if (weaverText.includes(AdSignifier)) {
    weaverText = await processM3U8(url, responseText, realFetch, PlayerType2);
}
if (weaverText.includes(AdSignifier)) {
    weaverText = await processM3U8(url, responseText, realFetch, PlayerType3);
}

This requests the main 'site' player type twice but the second one will get a new access token which can sometimes get you a clean stream faster. This constant swapping of the active m3u8 is the reason for that player pause/play / findReactNode() stuff to circumvent freezing.

Also see Purple AdBlock which is also pretty aggressive at requesting different player types https://github.com/arthurbolsoni/Purple-adblock/blob/main/serviceWorker/src/modules/stream/interface/stream.enum.ts

If this isn't good enough then you are looking for a proxy solution. See TTV LOL PRO https://github.com/younesaassila/ttv-lol-pro

@izar3
Copy link

izar3 commented Feb 25, 2024

weaverText = await processM3U8(url, responseText, realFetch, PlayerType2);
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType3);
}

Replace with:

weaverText = await processM3U8(url, responseText, realFetch, 'site');
if (weaverText.includes(AdSignifier)) {
    weaverText = await processM3U8(url, responseText, realFetch, PlayerType2);
}
if (weaverText.includes(AdSignifier)) {
    weaverText = await processM3U8(url, responseText, realFetch, PlayerType3);
}

I tested this for 4~ hrs with midrolls every 30-60 mins and this works way better

The only time I have seen it pause/play is at the start of a midroll but it's instant and always finds clean segments at source quality

ty pixeltris

@TsukiZero
Copy link
Author

So, the bug is back, that patch does nothing.

@guniu
Copy link

guniu commented Sep 19, 2024

I had video buffering issues and decided to look into code (I know nothing about js, just curiosity) and found this part:

} else if (e.data.key == 'ForceChangeQuality') {
//This is used to fix the bug where the video would freeze.
try {
//if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) {
return;
//}

It says "This is used to fix the bug where the video would freeze." but then it 'returns' immediately after doing nothing in result. Just checking if that is intentional or mistake in commenting out that 'if'?

@TsukiZero
Copy link
Author

I had video buffering issues and decided to look into code (I know nothing about js, just curiosity) and found this part:

} else if (e.data.key == 'ForceChangeQuality') {
//This is used to fix the bug where the video would freeze.
try {
//if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) {
return;
//}

It says "This is used to fix the bug where the video would freeze." but then it 'returns' immediately after doing nothing in result. Just checking if that is intentional or mistake in commenting out that 'if'?

uncommenting that causes the player settings to constantly be on screen, closing it only reopens it seconds after.

@placchio
Copy link

placchio commented Oct 9, 2024

I also have the loading/buffering issue during ads with vaft. When u start watching a stream it works, but then after a while (sometimes hours, sometimes 40mins, seems like it scales up with the amount of ads played by the streamer) the buffering/loading transition to the lower resolution when skipping the ad increases more and more until it becomes an endless buffering/loading. Only solution at that point is to manually pause/unpause the stream.
Also bad is that is that you cant even close the tab and reopen to fix it, you need to restart the browser (i use the ublock vaft script on chrome). But then the issue shows up again after a while.
Very awful bug.

@TsukiZero
Copy link
Author

both VAFT and Video-Swap-New are now halting COMPLETELY when a midroll starts, not even player reset resumes it, only full refresh does

@stevenya97
Copy link

Let's try to keep this a vaft focused discussion in this issue, and can get to video-swap-new later if this case is reproducible. To be clear, do you have just vaft script enabled/loaded? Using multiple scripts/twitch adblock solutions at once can cause playback to halt consistently. What is your extension/vaft setup? Not seeing that behavior where it requires a full refresh on my end, but maybe I can recreate yours.

@TsukiZero
Copy link
Author

Only one of them for sure. It was happening all the time yesterday, had to switch on the VPN to mitigate the issue.

@YofarDev
Copy link

I also have the same freeze problem with vaft since few weeks.

Here the logs (on Zen browser, a fork of firefox) when it happens :

XHRPOST
https://gql.twitch.tv/gql#origin=twilight
[HTTP/3 400 162ms]

7:31:44 PM [ERROR] [apollo] Received non-200 response from GraphQL. Error: Received non-200 response from GraphQL.
An https://assets.twitch.tv/assets/core-6fdb799352ac65d44bd2.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
h https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
h https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
An https://assets.twitch.tv/assets/core-6fdb799352ac65d44bd2.js:1
promise callback655275/e/this.apolloLinkFetch/An</< https://assets.twitch.tv/assets/core-6fdb799352ac65d44bd2.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
h https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
h https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
apolloLinkFetch https://assets.twitch.tv/assets/core-6fdb799352ac65d44bd2.js:1
y https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
e https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
subscribe https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
S https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
e https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
subscribe https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
bn https://assets.twitch.tv/assets/core-6fdb799352ac65d44bd2.js:1
e https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
subscribe https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
p https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
promise callback
25931/p/</< https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
e https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
subscribe https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
complete https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
start https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
t https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
getObservableFromLink https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
getResultsFromLink https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
b https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
fetchQueryByPolicy https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
x https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
fetchConcastWithInfo https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
fetchQuery https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
query https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
query https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
c https://assets.twitch.tv/assets/core-6fdb799352ac65d44bd2.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
h https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
h https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
c https://assets.twitch.tv/assets/core-6fdb799352ac65d44bd2.js:1
l https://assets.twitch.tv/assets/core-6fdb799352ac65d44bd2.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
h https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
h https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
l https://assets.twitch.tv/assets/core-6fdb799352ac65d44bd2.js:1
re https://assets.twitch.tv/assets/pages.channel.components.channel-shell.components.chat-shell.components.chat-live-b32edffe677229e9cefe.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1
s https://assets.twitch.tv/assets/vendor-feb2465b67ee100970e0.js:1

Object { status: 400 }
core-6fdb799352ac65d44bd2.js:1:1722344

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://sentry.io/api/1517394/envelope/?sentry_key=26325509987e418db03e96d12352a731&sentry_version=7&sentry_client=sentry.javascript.browser%2F8.27.0. (Reason: CORS request did not succeed). Status code: (null).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants