Skip to content

Fix transcript/annotation sync with playback for multi-source Canvas - #889

Merged
Dananji merged 3 commits into
mainfrom
transcript-sync
Dec 10, 2025
Merged

Fix transcript/annotation sync with playback for multi-source Canvas#889
Dananji merged 3 commits into
mainfrom
transcript-sync

Conversation

@Dananji

@Dananji Dananji commented Dec 4, 2025

Copy link
Copy Markdown
Collaborator

Related issue: #884

Changes in this PR:

  • Adjust time calculations for transcript cue/annotation synchronization with playback time to consider alternate start times when there are multiple sources
  • Adjust currentTime calcualation in the useMediaPlayer custom hook to consider alternate start times for multi-sourced canvases
  • Refactor the playback time synchronization for transcript cues/annotations to remove duplicated code for time calculations

@cjcolvar cjcolvar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great as far as I can tell!

I was hoping to do some manual testing with the IA manifest mentioned in the issue but I'm getting a 504 when attempting to fetch it.

Also I tried the opera one canvas cookbook manifest and it breaks when trying to go to the second source of the canvas. This is the error I'm seeing:

TypeError: can't access property "selected", originalQuality is undefined
    setSelectedQuality ramp-hooks.js:584
    useVideoJSPlayer ramp-hooks.js:381

Is it expected to work or does that recipe's manifest need fixing?

@Dananji

Dananji commented Dec 9, 2025

Copy link
Copy Markdown
Collaborator Author

@cjcolvar I just checked the IA Manifest and it is working now. This Manifest link has been flaky.

As for the cookbook recipe, I am unable re-produce the error you were seeing. But I will add a check for the originalQuality variable before setting its properties in the code. So that, it doesn't break.

@cjcolvar

Copy link
Copy Markdown
Member

I'm still running into the same issue with the opera canvas when I try to seek into the 2nd source (3. Atto Secondo (55:07)).

The IA manifest worked this time and it looks like transcript/annotations are in sync but the displayed captions don't seem to get switched out with the video source so the captions for the first 60 second source repeat for each source.

@Dananji

Dananji commented Dec 10, 2025

Copy link
Copy Markdown
Collaborator Author

I'm still running into the same issue with the opera canvas when I try to seek into the 2nd source (3. Atto Secondo (55:07)).

It'd be helpful if you can mention the steps you followed to get the error because I'm unable to reproduce the error. I tried scrubbing the progress bar and using the structured navigation to seek to the second source while the player is paused and playing. Or if it's easier we can hop onto Zoom to discuss this..

The IA manifest worked this time and it looks like transcript/annotations are in sync but the displayed captions don't seem to get switched out with the video source so the captions for the first 60 second source repeat for each source.

Yes! We may need a separate ticket to work on this. This synchronization is handled by VideoJS so it will need some investigation..
New Issue: #892

@cjcolvar

Copy link
Copy Markdown
Member

I refreshed my checkout and the cookbook recipe worked this time. 🎉

@Dananji
Dananji merged commit abe4c24 into main Dec 10, 2025
2 checks passed
@Dananji
Dananji deleted the transcript-sync branch December 10, 2025 22:10
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.

2 participants