pixeltris / TwitchAdSolutions

7.75k stars 446 forks source link

Fix freeze after ad detected, force pause/resume player #199

Open EchoDev opened 11 months ago

EchoDev commented 11 months ago

Potential fix for #187 for vaft

This forces a pause/play after an ad is detected, this fixed the video freezing issue for me.

pixeltris commented 11 months ago

This could result in quite a few pause/play on Source quality I think? Since that code will get hit each time it picks a different quality. Though several pause/plays would be better than freezing.

EchoDev commented 10 months ago

That could indeed be a problem for unstable connections. I haven't noticed anything wrong on a stable connection for what it is worth.

Keklul404 commented 10 months ago

The issue still happen with that change (freezing), tested on Auto and Source. I have a stable connection (desktop ethernet fiber 1gbs).

Forced to pause/play very often (~40s).

eXiGe commented 5 months ago

While this change helped a good bit with the video freeze during ads, I was still having the occasional freeze. I have been testing this tweak with a bit of delay for the past couple weeks and it seems to be working flawlessly for me.

setTimeout(postMessage({key: 'PauseResumePlayer'}), 500);

Just to test if anything changed in the latest version from 3 days ago, I removed this tweak, and it went back to freezing on mid-roll ad blocking.

EchoDev commented 5 months ago

I have been using this patch without a delay and it has been working fine for me for months.

The issue some people have is hard to debug for me since it always works but good to see a delay works for you

sham-pain commented 4 months ago

I opened an issue not realizing there is an open request here... Anyways, I actually asked chatGPT what I can do and I tried different options. the detect freeze didn't really work for me but the detect buffering did quite well. I'm not really familiar with coding, though. Wouldn't it be easiest to have the vaft script check for buffering (only when an ad is being blocked) to a threshhold and if buffering for more than that, hit pause and play?