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

Show transcript for lectures with subtitles #1403

Merged
merged 10 commits into from
Dec 5, 2024
Merged

Conversation

carlobortolan
Copy link
Member

Motivation and Context

See #1369.

Description

Updated web client to include the option to show lecture transcript with available subtitles.
When the transcript is enabled, the user can read/scroll/fast-forward through the text (see demo video below).

Steps for Testing

Prerequisites:

  • 1 Video with subtitles
  • 1 Video without subtitles
  1. Open a video.
  2. a "Show transcript" button should appear if it has subtitles.
  3. Now, you should be able to see the transcript next to the video (/ below the video if you're on a mobile device).

Screenshots

2024-11-12.15-04-23.mp4

@carlobortolan carlobortolan linked an issue Nov 12, 2024 that may be closed by this pull request
Copy link

Your Testserver will be ready at https://1403.test.live.mm.rbg.tum.de in a few minutes.

Logins
Kurs1 Kurs2 Kurs3 Kurs4
public public loggedin enrolled
prof1 prof1 prof2 prof1
prof2
student1
student2
student3
student1
student2
student2
student3
student1
student2

@carlobortolan carlobortolan self-assigned this Nov 12, 2024
@carlobortolan carlobortolan changed the title Feat/transcript Show transcript for lectures with subtitles Nov 12, 2024
@carlobortolan carlobortolan marked this pull request as ready for review November 19, 2024 15:15
@joschahenningsen joschahenningsen requested review from a team and joschahenningsen November 26, 2024 16:24
Copy link
Member

@joschahenningsen joschahenningsen left a comment

Choose a reason for hiding this comment

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

Very clean, like it a lot! Just left a few nits.

@@ -424,6 +424,22 @@
</div>
{{end}}

<!-- Transcript -->
<div id="transcript-desktop" x-cloak="" x-show="sidebar === watch.SidebarState.Transcript && transcriptAvailable"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<div id="transcript-desktop" x-cloak="" x-show="sidebar === watch.SidebarState.Transcript && transcriptAvailable"
<div id="transcript-desktop" x-cloak x-show="sidebar === watch.SidebarState.Transcript && transcriptAvailable"

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like a copy-paste error like the one related to the unnecessary ' 😅
image

I fixed it in my latest commit.

</button>
</div>
<div class="flex-grow overflow-hidden relative">
{{template "transcript-list" .}}
Copy link
Member

Choose a reason for hiding this comment

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

No need to pass any context, right?

Suggested change
{{template "transcript-list" .}}
{{template "transcript-list"}}

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

<!-- Transcript Button -->
<button x-show="transcriptAvailable" @toggletranscript.window="e => {transcriptAvailable=true}" @click="sidebar = (sidebar === watch.SidebarState.Transcript ? watch.SidebarState.Hidden : watch.SidebarState.Transcript)"
class="rounded-lg px-3 py-1 md:px-4 py-2 h-fit w-fit bg-gray-100 hover:bg-gray-200 dark:bg-secondary-light dark:hover:bg-gray-600"
:title="'Show Transcript'">
Copy link
Member

Choose a reason for hiding this comment

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

This way we don't need to run this string through javascript

Suggested change
:title="'Show Transcript'">
title="Show Transcript">

Copy link
Member

Choose a reason for hiding this comment

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

Seems like we made this mistake before in these files, feel free to clean them up if you want, if not no worries.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing that out; I removed all the unnecessary ' I could find in my latest commit.

@@ -1,12 +1,12 @@
import { getPlayers } from "./TUMLiveVjs";
import { copyToClipboard, Time } from "./global";
import { seekbarOverlay } from "./seekbar-overlay";
Copy link
Member

Choose a reason for hiding this comment

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

I assume this was unused?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes (see beginning & end of watch.ts file)

Copy link
Member

@joschahenningsen joschahenningsen left a comment

Choose a reason for hiding this comment

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

🚀

@joschahenningsen joschahenningsen merged commit d99062c into dev Dec 5, 2024
8 checks passed
@joschahenningsen joschahenningsen deleted the feat/transcript branch December 5, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show transcript for lectures with subtitles
2 participants