Skip to content

Player: Add OSD clock overlay in fullscreen#1322

Open
Infernoss2 wants to merge 5 commits into
Stremio:developmentfrom
Infernoss2:feat/osd-clock-overlay
Open

Player: Add OSD clock overlay in fullscreen#1322
Infernoss2 wants to merge 5 commits into
Stremio:developmentfrom
Infernoss2:feat/osd-clock-overlay

Conversation

@Infernoss2

@Infernoss2 Infernoss2 commented Jun 30, 2026

Copy link
Copy Markdown

Summary

Re-submission of the OSD clock overlay for #48 (fullscreen only, with a Settings → Player → Clock overlay section for show/format/position), addressing feedback from the earlier review.

What changed since the last review

  • Persistence: moved off localStorage to an in-memory React Context (useOsdClock), structured like the existing Discord RPC feature (Context + Provider + hook, with a sibling pure helpers.ts for time formatting). This isn't wired through core.transport.dispatch/profile.settings — those fields don't exist in stremio-core's Rust Settings struct yet, and adding them is a separate stremio-core PR. Until then, settings live in React state mounted at the app root (survive navigating in/out of the player, reset on a full page reload) — calling this out explicitly as a deliberate, temporary limitation rather than leaving it implicit.
  • i18n: replaced hardcoded label strings ('Show clock', 'Clock format', 'Clock position', etc.) with real SETTINGS_OSD_CLOCK_* SCREAMING_SNAKE_CASE keys, consistent with every other label in Settings/Player/Player.tsx. Not yet in stremio-translations; i18next falls back to the key string.
  • CSS: the overlay no longer has its own custom absolute-positioning styles. It's now a .clock-overlay-layer class in Player/styles.less, following the same --safe-area-inset-left/right/bottom convention as .nav-bar-layer/.control-bar-layer, with position (top-left/center/right) applied as a modifier class instead of inline styles.

Files changed

  • src/common/OsdClock/ — new Context/Provider/hook + pure helpers, replaces useOsdClockSettings.js
  • src/routes/Player/ClockOverlay/ — rewritten (.tsx) to consume the hook directly
  • src/routes/Player/styles.less — adds .clock-overlay-layer
  • src/routes/Player/Player.js — wires up useOsdClock() and the layer className
  • src/routes/Settings/Player/Player.tsx — i18n key labels
  • src/App/App.js — mounts OsdClockProvider

Infernoss2 and others added 2 commits June 30, 2026 14:51
- useOsdClockSettings hook: localStorage-backed enabled/format/position
- ClockOverlay component: ticks every second, Intl.DateTimeFormat for 12h/24h/auto
- Settings → Player: new OSD Clock category with toggle + two dropdowns
- Player.js: renders ClockOverlay only when fullscreen && enabled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kKaskak

kKaskak commented Jun 30, 2026

Copy link
Copy Markdown
Member

happy to reopen your pr if you read how new features should be implemented per repo guidelines thank you

@kKaskak kKaskak closed this Jun 30, 2026
@Infernoss2

Copy link
Copy Markdown
Author

happy to reopen your pr if you read how new features should be implemented per repo guidelines thank you

where can i read "how new features should be implemented"?
i searched in this repo but didnt find anything.

@kKaskak

kKaskak commented Jun 30, 2026

Copy link
Copy Markdown
Member

happy to reopen your pr if you read how new features should be implemented per repo guidelines thank you

where can i read "how new features should be implemented"? i searched in this repo but didnt find anything.

you can check the previous merged prs by other contributors and check stremio-core and other repos under stremio org for more info how stremio works, check contribution guide as well

@Infernoss2

Copy link
Copy Markdown
Author

happy to reopen your pr if you read how new features should be implemented per repo guidelines thank you

where can i read "how new features should be implemented"? i searched in this repo but didnt find anything.

you can check the previous merged prs by other contributors and check stremio-core and other repos under stremio org for more info how stremio works, check contribution guide as well

Im sorry I didnt find any contribution guide in here.
Can you direct me to a place that I could read the exact guidline for new features pls?

profile.settings has no OSD clock fields yet in stremio-core, so this
can't be wired through core.transport.dispatch. Use a Context/Provider/
hook (mirrors the Discord RPC precedent's structure) instead of the
localStorage-backed useState hook it replaces; settings reset on reload
until the fields exist upstream.
…nvention

Replace ClockOverlay's custom absolute-positioning CSS with a
.clock-overlay-layer class in Player/styles.less, following the same
--safe-area-inset-left/right/bottom pattern as .nav-bar-layer and
.control-bar-layer. Position (top-left/center/right) is now a modifier
class resolved by Player.js, not inline styles. Converts the component
to .tsx and has it read settings from useOsdClock() directly.
Replace hardcoded strings ('Show clock', 'Clock format', 'Clock
position', etc.) with SCREAMING_SNAKE_CASE keys passed through t(),
matching every other label in this file. Keys aren't in
stremio-translations yet; i18next falls back to the key string.
@Infernoss2 Infernoss2 changed the title feat(player): add OSD clock overlay in fullscreen (#48) Player: Add OSD clock overlay in fullscreen Jul 1, 2026
@Infernoss2

Copy link
Copy Markdown
Author

@kKaskak could you reopen this when you get a chance? I don't have permission to reopen it myself since you closed it, but the branch now has fixes for the points from the earlier review (full details in the updated PR description above):

  • Settings moved off localStorage to an in-memory Context (useOsdClock), matching the structure of the existing Discord RPC feature.
  • Labels use real i18n key constants (SETTINGS_OSD_CLOCK_*) instead of hardcoded strings.
  • The overlay CSS now follows the existing .nav-bar-layer/.control-bar-layer + --safe-area-inset-* convention instead of custom positioning.

If anything's still not lining up with repo conventions, I'd really appreciate a pointer to the specific line or pattern you'd want it to follow instead of general guidance — I want to make sure I'm fixing the right thing rather than guessing, and I'm happy to keep iterating on this.

@kKaskak kKaskak reopened this Jul 1, 2026
@Infernoss2 Infernoss2 marked this pull request as ready for review July 1, 2026 21:13
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