Skip to content

Conversation

@jakub-roch
Copy link
Contributor

I introduced new plugin as replacement for SRT/Paced transcript. The main reason is to add same behaviour for different file types of lazy loading all transcript files.

Key points:

  • New TextTrackManager plugin
  • Different parsers for 3 types (SRT, VTT, TRANSCRIPT)
  • Every text track is being added but as an "empty" entity (without cues)
  • After selecting track user triggers loading
  • Transcript files with extra behaviour -> 202 http code in response means to retry after X seconds (polling) until user gets error or success
  • AbortController to stop loading (or polling) for subtitle file if user changes to another language
  • Selected language being used to add Notification Cue
  • For now when loading takes more than 1 attempt (around 2 seconds) we show some text like "Loading text track"
  • If loading failed new notification cue "persistent" per current session is attached to text track (so once user select this language again after switching he will see message about error)

@jakub-roch jakub-roch requested a review from a team as a code owner August 11, 2025 06:47
@netlify
Copy link

netlify bot commented Aug 11, 2025

Deploy Preview for cld-vp-esm-pages ready!

Name Link
🔨 Latest commit 00a208b
🔍 Latest deploy log https://app.netlify.com/projects/cld-vp-esm-pages/deploys/689d94ebe01e670008fa24ae
😎 Deploy Preview https://deploy-preview-898--cld-vp-esm-pages.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Aug 11, 2025

Deploy Preview for cld-video-player ready!

Name Link
🔨 Latest commit 00a208b
🔍 Latest deploy log https://app.netlify.com/projects/cld-video-player/deploys/689d94eb49dded0008a21a3e
😎 Deploy Preview https://deploy-preview-898--cld-video-player.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Collaborator

@tsi tsi left a comment

Choose a reason for hiding this comment

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

Great work! Approving following our zoom call.

Please make sure you go over the points raised in our call - chapters, playlist-by-tag example (to test source switching), create a small test instead of the removed unit test.

Also, since this new plugin is lazy-loaded, make sure you update index.all.js

Comment on lines +136 to +138
setTimeout(() => {
textTrack.mode = currentMode;
}, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Must have the timeout here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, its small improvement for UX - sometimes I noticed that once language is changed its kept until some click so this one triggers repainting

onSuccess: () => updateTextTrackStatusToSuccess(track),
onError: (error) => {
updateTextTrackStatusToError(track, error);
addNotificationCue(player.duration(), track, 'We could not load selected text track, sorry');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's confirm this and other UI strings with @njb90

Copy link
Contributor Author

Choose a reason for hiding this comment

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

confirmed & replaced

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.

3 participants