Skip to content

[BUG FIX] [MER-5224] [MER-5225] Correct video mime type & handle video poster image URL#292

Merged
rgachuhi merged 4 commits intomasterfrom
MER-5224-fix-video-mime-type
Jan 26, 2026
Merged

[BUG FIX] [MER-5224] [MER-5225] Correct video mime type & handle video poster image URL#292
rgachuhi merged 4 commits intomasterfrom
MER-5224-fix-video-mime-type

Conversation

@andersweinstein
Copy link
Contributor

@andersweinstein andersweinstein commented Jan 26, 2026

This fixes two issues in the migration of video elements that gave rise to problems in a migrated french course:

  1. Mime type on element was hardcoded to video/mp4, even if video uses another format like video/webm. A mismatch is apparently harmless in Chrome, but caused playback to fail in Safari (https://eliterate.atlassian.net/browse/MER-5210) This corrects to infer from extension. (Note video's mime type was already being inferred correctly from extension when written into media manifest; this only affects contenttype specified in the video content element json.)

  2. Legacy allowed a "poster" attribute on the video element to specify a poster image, an optional static image (usually a still frame) to be shown before video starts to play. Poster image URLs were not hit in the URL translation phase though the poster attribute passes through, leaving the migrated videos with bad legacy URLs (e.g. "../webcontent/myposter.jpg"), so that poster images fail to load. This corrects migration tool to translate URLs in video poster attributes.

While working on 2, also attempted some AI-assisted cleanup of the messy code that finds and translates URLs in DOM elements, mainly to be driven from a table of target element descriptors rather than lots of if-else cases.

@rgachuhi rgachuhi merged commit 36873ba into master Jan 26, 2026
2 checks passed
@rgachuhi rgachuhi deleted the MER-5224-fix-video-mime-type branch January 26, 2026 14:30
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