[FEATURE] An option to keep tracking when there are videos playing
I noticed this extension stops tracking even when there are videos playing in the tab. tried it on both Youtube and Twitch even on theater mode. I do know it works in fullscreen, I just thought id be better if it also worked on windowed
@Vran-n I agree with you and I've tried this before.
but it's really hard to judge if the video should be tracked. sometimes there is a video elememt in the dom tree, while it's actually hidden or no size. and sometimes it just plays in some unconspusuous places without eye catching. So I only force to track the fullscreen time.
This might be implemented after detailed designing, i think
@sheepzh Are there any cases wherein it isnt too difficult to judge? Because my suggestion is to split updates into potentially 2 parts if that were the case like putting exceptions in some major sites.
I know you.
I will implement this feature after I think it through, for now I will just hang on. Thanks for your feedback~
I noticed it too. I was watching a Youtube video that is not full screen on Firefox browser. It stopped tracking after 10 minutes. Tracking works fine when watching full screen videos.
but it's really hard to judge if the video should be tracked. sometimes there is a video elememt in the dom tree, while it's actually hidden or no size. and sometimes it just plays in some unconspusuous places without eye catching. So I only force to track the fullscreen time.
Can this be a setting that can be toggled by the user "Keep tracking when videos are playing"? This can be off by default.
I understand that videos could be intentional (ex. Youtube) or unintentional (ex. Some websites playing video ads) but at least the user can decide to accept this possibility.
To track / pause time when audio is playing for a particular tab. tab.audible property true = tab is currently playing audio false = tab is silent
So it knows when any tab is making sound regardless of whether it's active or in the background.
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (changeInfo.audible !== undefined) {
if (changeInfo.audible === true) {
// Start tracking time for this tab
startTimer(tabId, tab.url);
} else {
// Stop tracking time for this tab
stopTimer(tabId);
}
}
});
if someone wanted to bypass this they could watch video muted and true this won't detect it but this is a simple way to limit oneself to a daily limit of video/audio consumption.
by judging audio on or off is really a good idea. I ll consider it, thank you @mrfragger
but the time tracking event is sent by content script from tabs. so we need to find another API to listen audio paused or resumed. also welcome to PR
finished in v3.7.3