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

HLS captions for iOS #5082

Merged
merged 1 commit into from
Feb 28, 2023
Merged

HLS captions for iOS #5082

merged 1 commit into from
Feb 28, 2023

Conversation

masaball
Copy link
Contributor

Proof of concept for providing captions in HLS manifest. Test on Browserstack and evaluate approach.

@@ -325,6 +325,11 @@ def hls_manifest
end
end

def caption_manifest
return head :unauthorized if cannot?(:read, @master_file)
@caption = @master_file.captions
Copy link
Contributor Author

@masaball masaball Feb 27, 2023

Choose a reason for hiding this comment

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

@caption = master_file.captions is unnessary for final implementation. The caption_manifest erb file does not acually make use of this but rather uses the captions_master_file_path. Shouldn't interfere with testing though.

@@ -14,7 +14,8 @@ Unless required by applicable law or agreed to in writing, software distributed
--- END LICENSE_HEADER BLOCK ---
%>
#EXTM3U
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",LANGUAGE="en",NAME="English",AUTOSELECT=YES,URI="<%= caption_manifest_master_file_path %>"
Copy link
Contributor Author

@masaball masaball Feb 27, 2023

Choose a reason for hiding this comment

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

Final implementation could have a setting to specify a default caption language to avoid having to hardcode it as english. If this approach is implemented, would be good to eventually circle back and allow editors to define caption language, as well as provide an option to provide multiple caption files.

Comment on lines +50 to +51
resource '/master_files/*/caption_manifest', headers: :any, methods: [:get]
resource '/master_files/*/captions', headers: :any, methods: [:get]
Copy link
Contributor Author

@masaball masaball Feb 27, 2023

Choose a reason for hiding this comment

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

Not sure if necessary for final implementation. These are necessary when an HLS manifest with captions is requested by an external player such as Ramp, but depending on how iOS handles the requests it may not be through CORS. If we are able to provide captions to IIIF players via the IIIF manifest, then the captions being included in the HLS manifest may only be necessary for iOS.

Copy link
Member

@cjcolvar cjcolvar left a comment

Choose a reason for hiding this comment

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

Looks fine for testing. We'll need to clean things up and add tests later.

@cjcolvar cjcolvar merged commit 9e6b71e into develop Feb 28, 2023
@cjcolvar cjcolvar deleted the hls_subtitles branch February 28, 2023 14:28
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