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

tracking watched videos: missing a minimum in seconds & percent of the video duration. We count played time (analyzer feature). We can store the percentages watched. And the exact parts to mark them up on the player's time bar. And skip them or rehearse them exclusively (skip all else) #2238

Open
ImprovedTube opened this issue May 4, 2024 · 4 comments
Labels
Bug Bug or required update after YouTube changes Completion / Revision Rethink, complete, improve, tweak our feature or structure. Feature request Wish or idea good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥

Comments

@ImprovedTube
Copy link
Member

ImprovedTube.videoPageUpdate = function () {
if (document.documentElement.dataset.pageType === 'video') {
var video_id = this.getParam(new URL(location.href).search.substr(1), 'v');
if (this.storage.track_watched_videos === true && video_id) {
ImprovedTube.messages.send({action: 'watched',
type: 'add',
id: video_id,
title: document.title
});
}

counting seconds here already:

ImprovedTube.playerOnTimeUpdate = function() {
var currentTime = Date.now();
if (!timeUpdateInterval) {
timeUpdateInterval = setInterval(function() {
if (ImprovedTube.video_src !== this.src) {
ImprovedTube.video_src = this.src;
if (ImprovedTube.initialVideoUpdateDone !== true) {
ImprovedTube.playerQuality();
}
} else if (ImprovedTube.latestVideoDuration !== this.duration) {
ImprovedTube.latestVideoDuration = this.duration;
ImprovedTube.playerQuality();
}
ImprovedTube.alwaysShowProgressBar();
ImprovedTube.playerRemainingDuration();
ImprovedTube.played_time += .5;
}, 500);
}
clearInterval(noTimeUpdate);
noTimeUpdate = setTimeout(function() {
clearInterval(timeUpdateInterval);
timeUpdateInterval = null;
}, 987);
};
ImprovedTube.playerOnLoadedMetadata = function () {
setTimeout(function () {ImprovedTube.playerSize();}, 100);
};
ImprovedTube.playerOnPause = function (event) {
ImprovedTube.playlistUpNextAutoplay(event);
if (ImprovedTube.elements.yt_channel_name) {
ImprovedTube.messages.send({action: 'analyzer',
name: ImprovedTube.elements.yt_channel_name.__data.tooltipText,
time: ImprovedTube.played_time
});
}
ImprovedTube.played_time = 0;
ImprovedTube.playerControls();
ImprovedTube.playerCinemaModeDisable();
};
ImprovedTube.playerOnEnded = function (event) {
ImprovedTube.playlistUpNextAutoplay(event);
ImprovedTube.messages.send({action: 'analyzer',
//adding "?" (not a fix)
name: ImprovedTube.elements.yt_channel_name?.__data.tooltipText,
time: ImprovedTube.played_time
});
ImprovedTube.played_time = 0;
};

@ImprovedTube ImprovedTube added Bug Bug or required update after YouTube changes help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* Completion / Revision Rethink, complete, improve, tweak our feature or structure. up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels May 4, 2024
@ImprovedTube ImprovedTube changed the title tracking watched videos: there should be a minimum in seconds and/or percent of the video duration. we already count played time for the analyzer feature. tracking watched videos: there should be a minimum in seconds and/or percent of the video duration. we already count played time for the analyzer feature. We could store the percentage watched. And the exact parts to mark them up on the player's time bar. May 4, 2024
@ImprovedTube ImprovedTube changed the title tracking watched videos: there should be a minimum in seconds and/or percent of the video duration. we already count played time for the analyzer feature. We could store the percentage watched. And the exact parts to mark them up on the player's time bar. tracking watched videos: missing a minimum in seconds & percent of the video duration. We count played time (analyzer feature). We can store the percentages watched. And the exact parts to mark them up on the player's time bar. May 4, 2024
@ImprovedTube ImprovedTube added the Feature request Wish or idea label May 4, 2024
@ImprovedTube ImprovedTube changed the title tracking watched videos: missing a minimum in seconds & percent of the video duration. We count played time (analyzer feature). We can store the percentages watched. And the exact parts to mark them up on the player's time bar. tracking watched videos: missing a minimum in seconds & percent of the video duration. We count played time (analyzer feature). We can store the percentages watched. And the exact parts to mark them up on the player's time bar. And skip them or rehearse them exclusively (skip all else) May 4, 2024
@raszpl
Copy link
Contributor

raszpl commented May 4, 2024

That would take a TON of storage. Btw Analyzer is totally broken for me.

Personally what I do in my own browser to track watched videos is simple CSS mod unlocking different color for Visited video links (YT tries to display all in same color). Cheap (browser holds this data anyway), fast (browser native functionality) and easy to spot.

@ImprovedTube
Copy link
Member Author

That would take a TON of storage.

Yes!💪😳 up to 0.00000x Harddrives.
Less than storing titles next to video IDs.

CSS

👍🤫 #482 (comment) @raszpl

running our feature at all, #2238 will be the main advantage. (Considering yours could also make the data available easily, if you added a tag to the URLs in history (until the browser history expires) )


( without watch history or analyzer we still always run this playback heartbeat:

 playerOnTimeUpdate
       ....
 				ImprovedTube.alwaysShowProgressBar(); 
 				ImprovedTube.playerRemainingDuration(); 
 				ImprovedTube.played_time += .5; 
 			}, 500); 

bda492c
)

@raszpl
Copy link
Contributor

raszpl commented May 10, 2024

That would take a TON of storage.

Yes!💪😳 up to 0.00000x Harddrives.

and how much % of users hard drive can one extension use?

@ImprovedTube
Copy link
Member Author

unlimited 🤫 (with extension permission storage in the manifest. doesn't have to be confirmed. Else only 10mb chrome.storage whyever. And you might have seen websites (/bugs) just storing gigabytes. ) ( 2. only 0.1mb for chrome storage sync (Still enough videosID for example, if you will. Could be converted to base256 ))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug or required update after YouTube changes Completion / Revision Rethink, complete, improve, tweak our feature or structure. Feature request Wish or idea good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥
Projects
None yet
Development

No branches or pull requests

2 participants