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

Support captions for audio and video manifests with ranges #95

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

Conversation

DanOlson
Copy link

@DanOlson DanOlson commented Jul 25, 2024

This provides support for rendering captions when the manifest's annotation items have a text type rendering of format 'text/vtt'.

I'm hoping to gather input on direction, and use this as a starting point for moving this issue forward. In UV, manifests without ranges support captions via MediaElement.js for video content, but there is not yet caption support audio content or for manifests with ranges. Since this component is used when rendering ranged manifests, I've taken a stab at an implementation modeled after that of MediaElement.js.

It's mostly working well, though I'm seeing intermittent issues when jumping from one range to another, where captions will occasionally not display without "help" (pause then play, seek 20s forward or backward, etc). It seems to work when playing straight through, however, so it may be something to do with the jump to the exact boundary of the range. I suspect a synchronization issue between the CanvasInstance's _canvasClockTime and the start/end values of the current/newly active content annotation after the jump to the next range. I'm hoping one of you maintainers might have some advice in that area, otherwise, I'll continue to look into it.

EDIT: I believe the above issue is resolved

The below manifest URLs should work with the demo player (the one shown when running npm start)

Example manifest for video

https://gist.githubusercontent.com/DanOlson/02d2a7a0ca7e6ef539e415211077971b/raw/e28716b897089cb0236646f561b647b760ca7461/chamreun-tam.json

Example manifest for audio

https://gist.githubusercontent.com/DanOlson/4c4f0edf43439546019a2314caf69e12/raw/cf288d39d839e48101cf90d8e2008be8c2c92449/interview-with-alberto-monserrate.json

Please let me know if you have any questions, need additional manifest examples, or anything else. I'm very excited to get this issue over the line.

Addresses UniversalViewer/universalviewer#747

Copy link

codesandbox-ci bot commented Jul 25, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@@ -95,7 +105,6 @@ export class CanvasInstance extends BaseComponent {
this._$element = $(this.options.target);
this._data = this.options.data;
this.$playerElement = $('<div class="player player--loading"></div>');
this.$playerElement.hide();
Copy link
Author

Choose a reason for hiding this comment

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

I had to remove this in order to see the controls container on the demo application. Doing so didn't seem to have a negative effect when building the library into UV either, so I'm not sure if this is needed.

This provides support for rendering captions when the manifest's
annotation items have a text type rendering of format 'text/vtt'.

The implementation is modeled after that of MediaElement.js
@demiankatz
Copy link

I imagine that this PR is going to be discussed as part of this week's UV accessibility sprint. However, I have never worked with the AV component, so I don't feel particularly well-equipped to review. Wondering if @stephenwf might be willing to take a look....

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