NDevTK / AutoPause

Browser extension to pause other audio and video sources if audio is playing on the active tab with automatic resume, fast forward and media controls.
https://addons.mozilla.org/firefox/addon/autopause/
MIT License
31 stars 6 forks source link

Suggestion. "Pause all" hotkey or/and queue limit #43

Closed ilapro53 closed 9 months ago

ilapro53 commented 9 months ago

When I open multiple tabs with media playing, a queue of paused media is formed. Sometimes this is very convenient, but if there are too many paused media, it can be difficult to pause them all.

I suggest adding a hotkey to pause all media (i.e. to clear the queue and stop the playing media)

I would also suggest adding a limit to the queue size. The oldest media that exceed the limit will be stopped permanently without automatic continuation.

Sorry for the machine translation

NDevTK commented 9 months ago

Seems currently the only way to pause all media is to enable 'checkidle' and lock the device https://github.com/NDevTK/AutoPause/blob/7ef5370b2c85f2df925ec85a900e112538cbfeab/background.js#L534

I should be able to add a hotkey to pause all without resuming other media without clearing the queue. (fix togglePlayback) would that work for you?

NDevTK commented 9 months ago

Using the latest build https://github.com/NDevTK/AutoPause/actions/ does the "togglePlayback" fix your issue?

Currently the design works assuming all media gets tracked not just the top x however what limit would be good?

NDevTK commented 9 months ago

I have now setup a basic system to stop autoresume after 5 tabs :)

ilapro53 commented 9 months ago

Seems currently the only way to pause all media is to enable 'checkidle' and lock the device

https://github.com/NDevTK/AutoPause/blob/7ef5370b2c85f2df925ec85a900e112538cbfeab/background.js#L534

I should be able to add a hotkey to pause all without resuming other media without clearing the queue. (fix togglePlayback) would that work for you?

If I understand correctly, then yes, this solution would be wonderful!

ilapro53 commented 9 months ago

Using the latest build https://github.com/NDevTK/AutoPause/actions/ does the "togglePlayback" fix your issue?

Currently the design works assuming all media gets tracked not just the top x however what limit would be good?

I have now setup a basic system to stop autoresume after 5 tabs :)

I installed the extension for Firefox from here: https://github.com/NDevTK/AutoPause/actions/runs/7735249011. I noticed a new option "Dont resume old media" and enabled it. But I checked on 15 YouTube Music tabs: I turned on one by one from tab 1 to tab 15, then stopped from 15 to 2. Only tab 1 did not start playing automatically. Turning off "Dont resume old media" doesn't seem to change anything 🤔

Maybe I did something wrong or misunderstood?

NDevTK commented 9 months ago

It should now be fixed in the latest build both togglePlayback and "Dont resume old media" (before it would only track one old tab)

ilapro53 commented 9 months ago

Oh, sorry. It seems the Toggle Playback feature was present in the old version. I missed it. In the last build (1304) it works too.

About "Dont resume old media": in the last build (1304) it doesn't work, but it works in build 1299 (as expected 5 tabs continued to play)

NDevTK commented 9 months ago

Oh nice so do you think this issue is now resolved?

NDevTK commented 9 months ago

I will now start the process of testing + publishing the build https://github.com/NDevTK/AutoPause/actions/runs/7746163299

ilapro53 commented 9 months ago

Oh nice so do you think this issue is now resolved?

I think yes. I would suggest adding field for custom amount of "not old tabs" if "Dont resume old media" will work, but it's up to you

ilapro53 commented 9 months ago

I will now start the process of testing + publishing the build https://github.com/NDevTK/AutoPause/actions/runs/7746163299

It seems that "Dont resume old media" also don't work in this build.

NDevTK commented 9 months ago

Yeah should be fixed in https://github.com/NDevTK/AutoPause/actions/runs/7746380808

Lost code from the merge

NDevTK commented 9 months ago

If I was not the only one coding it maybe there would be tests to catch stuff like this but nope :(

ilapro53 commented 9 months ago

If I was not the only one coding it maybe there would be tests to catch stuff like this but nope :(

I'd like to help, but I'm afraid I only know Python 😢

NDevTK commented 9 months ago

Good news this issue should now be fixed in 2.8.4 currently released on chrome and firefox. :)

Regarding only knowing Python... you can look at the code and guess.

NDevTK commented 9 months ago

Please confirm the issue is fixed in the latest extension version 2.8.4 so this can be closed.

ilapro53 commented 9 months ago

Good news this issue should now be fixed in 2.8.4 currently released on chrome and firefox. :)

Thanks, is works!

Regarding only knowing Python... you can look at the code and guess.

Maybe I'll check your repository from time to time)