Repository navigation
FIX: Show a poster for Mux videos and play them inline on mobile - #103
Merged
Merged
Conversation
Previously, the `<video>` rendered for a ready Mux video had no `poster`, so on mobile the player could show no preview until playback started, and without `playsinline` Safari on iPhone played it fullscreen instead of inside the post. This change uses the Mux thumbnail at the one second mark as the poster and sets `playsinline`. Without a size, Mux serves that thumbnail at the source video's resolution, larger than the player needs. Mux scales it to fit the requested box, upscaling if needed, so capping only the width would enlarge 1080p portrait videos. Bounding both sides to 1280x1920 gives a 1080p landscape video a 1280x720 poster and keeps a portrait one at its 1080x1920 size. It also adds an acceptance test for rendering a ready video in a post, which nothing covered. Co-authored-by: Luiz Gustavo Schiller <schillerbr@gmail.com>
This was referenced Oct 22, 2026
Grubba27
approved these changes
Oct 22, 2026
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.
Previously, the
<video>rendered for a ready Mux video had noposter, so on mobile the player could show no preview until playback started, and withoutplaysinlineSafari on iPhone played it fullscreen instead of inside the post.This change uses the Mux thumbnail at the one second mark as the poster and sets
playsinline. Without a size, Mux serves that thumbnail at the source video's resolution, larger than the player needs. Mux scales it to fit the requested box, upscaling if needed, so capping only the width would enlarge 1080p portrait videos. Bounding both sides to 1280x1920 gives a 1080p landscape video a 1280x720 poster and keeps a portrait one at its 1080x1920 size.It also adds an acceptance test for rendering a ready video in a post, which nothing covered.
Includes the fix from #102 by @schiller, with the poster thumbnail size capped and an acceptance test.
Part of a stack of PRs, to be merged in order:
Co-authored-by: Luiz Gustavo Schiller schillerbr@gmail.com