Skip to content

Add ability to view video transcripts to the Invidious frontend #5298

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

syeopite
Copy link
Member

Closes #2564

transcripts widget
video description transcript toggle

The current description box isn't really designed to hold non preformatted content hence the extraneous spacing at the bottom. Once #4111 is merged the description box should get a redesign to better accommodate these description widgets and how they should be affected by the expand description user preference.

@syeopite syeopite requested review from SamantazFox and a team as code owners May 11, 2025 04:02

addEventListener("DOMContentLoaded", () => {
const transcriptLines = document.getElementById("lines");
for (const transcriptLine of transcriptLines.children) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend adding the click event listener on transcriptLines and checking the event's target. This would have better performance than adding an event listener onto each transcriptLine

@@ -195,3 +195,15 @@ addEventListener('load', function (e) {
comments.innerHTML = '';
}
});

addEventListener("DOMContentLoaded", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember if internet explorer is still a supported browser or not but arrow functions aren't supported in IE. So if it is still supported it will need to be changed. https://caniuse.com/arrow-functions

Suggested change
addEventListener("DOMContentLoaded", () => {
addEventListener("DOMContentLoaded", function() {

margin: 0;
}

.transcript-line:hover, .selected.transcript-line, .transcript-title-line:hover, .selected.transcript-title-line {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hovering looks great on light mode, but it doesn't look great on dark mode (the default used by invidious).

2025-05-13_12-10

Suggested change
.transcript-line:hover, .selected.transcript-line, .transcript-title-line:hover, .selected.transcript-title-line {
.transcript-line:hover, .selected.transcript-line, .transcript-title-line:hover, .selected.transcript-title-line {
background: #4f4f4f;
}
.light-theme .transcript-line:hover, .selected.transcript-line, .transcript-title-line:hover, .selected.transcript-title-line {
background: #cacaca;
}

With the suggestion, it now looks like this:

2025-05-13_12-27
2025-05-13_12-12

@Fijxu
Copy link
Member

Fijxu commented May 13, 2025

In testing on https://inv.nadeko.net with my CSS suggestion applied

R0gu3h3h3h3 pushed a commit to R0gu3h3h3h3/oiia that referenced this pull request May 16, 2025
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

Successfully merging this pull request may close these issues.

[Feature request] Add support for transcripts
3 participants