[DRAFT] Display VTT transcripts in audio/video players#7418
Draft
eltiffster wants to merge 24 commits intomainfrom
Draft
[DRAFT] Display VTT transcripts in audio/video players#7418eltiffster wants to merge 24 commits intomainfrom
eltiffster wants to merge 24 commits intomainfrom
Conversation
… into simple form
…notations tab of Clover IIIF viewer. "l" is supposed to refer to the <ItemStyled> object in Annotation (https://github.com/samvera-labs/clover-iiif/blob/main/src/components/Viewer/InformationPanel/Annotation/Item.styled.tsx). In the minified version of this file, this should actually be uppercase L, not lowercase l. `l("span",{style:{backgroundImage` was changed to `L("span",{style:{backgroundImage` `return l(n9,{dir:P,"data-format"` was changed to `return L(n9,{dir:P,"data-format"` There appears to be an unnecessary call to `l()` in the following switch/case statement: ``` case "text/vtt": return l(HQ, { inlineCues: k, label: A, vttUri: ((D = y[0]) == null ? void 0 : D.id) || void 0 }); ``` In fact, `return l(HQ,{inlineCues:k` can be changed to `return HQ({inlineCues:k` since HQ is a function in the minified file.
…ion for other file types seems unfinished and doesn't work.
…f the solr document. Do not make language a required field for a file set.
…ix some formatting and specs.
…s with multiple files are visible.
… Remove tests for code that was already tested/covered elsewhere.
… since it's not required by the viewer.
Test Results 17 files ± 0 17 suites ±0 3h 27m 35s ⏱️ - 1m 42s For more details on these failures, see this check. Results for commit b7dfbac. ± Comparison against base commit b5f81f9. This pull request removes 448 and adds 492 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allow users to select and display WebVTT files as transcripts/captions for audio/video files.
Guidance for testing, such as acceptance criteria or new user interface behaviors:
.dassieor/app/samvera/hyrax-webappin Docker), runrails generate hyrax:iiif_viewer cloverto installrails destroy hyrax:iiif_viewer clover, thenrails generate hyrax:iiif_viewer cloverto reinstall fresh copies of the viewer files. Theclover.jsfile was altered to fix this issue and an extra class was added to adivinclover.html.erb.Type of change (for release notes)
notes-major(I think) due to needing to install a new gem for convertinglanguagefield values into a language code readable by the IIIF viewerDetailed Description
This is a continuation of work started before/during the March 2026 Community Sprint. More context/discussion on implementation was recorded on the the Sprint Board.
After uploading VTT file(s) to a work with an audio/video (AV) file, users can choose to use the VTT file as the subtitles/captions file for the corresponding audio/video. This is done by editing the AV file set, selecting the VTT file by title, and saving the AV file set (see screenshot below). Under the hood, the VTT file set ids are saved to the
transcript_idsattribute of the AV file and indexed astranscript_ids_ssimin the AV file's Solr document.The transcript(s) form is populated by a Solr query that searches for "sibling" file sets (i.e. file sets of the same parent work as the AV file set) with a
text/vttmime type. Currently,text/vttis the only accepted mime type, but other mime types could be added in future. Users can select multiple VTT files per audio/video file. This approach also supports a nested work structure where a child work has a different transcript than other child works or its parent work.Selected transcripts are displayed via a
<track>element in default audio/video partials. When using a IIIF AV viewer, the transcript is displayed in a IIIF manifest via an annotation, following the pattern of this IIIF cookbook recipe:Thanks to @kirkkwang and @trmccormick for their previous work on this!
Changes proposed in this pull request:
transcript_idsandlanguageproperties/attributes to ActiveFedora and Hyrax file set classes, their respective form classes, and their respective indexerstranscript_idsandlanguageform fields in the file set edit formHyrax::FileSetPresentertorender_media_display_partialinstead of a Solr document (inapp/views/hyrax/file_sets/edit.html.erb)<track>elements toapp/views/hyrax/file_sets/media_display/_video.html.erbandapp/views/hyrax/file_sets/media_display/_audio.html.erb: initial idea and technical plan by @trmccormickPossible Future Work
views/hyrax/file_sets/_form.html.erbpartial for ActiveFedora file sets, while the Valkyrie version uses thehydra-editorgem, which renders partials inviews/records/edit_fields. Is there a reason for this difference? Should the form be refactored?clover.jsfile.@samvera/hyrax-code-reviewers