Skip to content

Fit videos and images per asset - #54

Merged
514sid merged 1 commit into
mainfrom
fit-modes
Nov 24, 2026
Merged

514sid merged 1 commit into
mainfrom
fit-modes

Conversation

@514sid

@514sid 514sid commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Content rarely has the screen's exact shape. GaplessAsset gets two fields, both per asset:

  • fit: Contain (the old behaviour and the default), Cover, Stretch or Original. Original shows the picture at its own size in layout pixels, centred, cropped when larger and barred when smaller.
  • backgroundColor: the ARGB colour of the bars, opaque black by default.

Web pages lay themselves out and ignore both.

Video slots now track the picture's pixel size instead of only its aspect ratio, so Original can draw it unscaled. A frozen frame during a hard cut keeps its framing until the new clip draws, as it already kept its shape. Image preloads decode the way the slot will show the image (fit inside, fill, or whole for Original), so the slot's own request stays a cache hit. Each image slot's background now draws inside its fade.

The sample app takes --es fit cover and --es background 202020, and assets in samples.json can set fit and background. The colour goes without # because the device shell reads # as a comment.

Checked on both TVs: a portrait video in each mode with coloured bars, and a 640x360 image at its own size.

…size

GaplessAsset gets fit and backgroundColor. Video slots track the picture's
pixel size so Original can show it unscaled, and image preloads decode the
way the slot will show the image so the slot stays a cache hit. The sample
app takes fit and background as launch extras and in samples.json.
@514sid
514sid merged commit e453774 into main Nov 24, 2026
1 check passed
@514sid
514sid deleted the fit-modes branch November 24, 2026 12:20
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.

1 participant