Commit graph

6362 commits

Author SHA1 Message Date
AK
90e2cbff15 chore(fullscreen): drop ts-expect-error, type ctx + NewState properly
useServices is already typed via src/services/ServicesContext/useServices.d.ts,
so the @ts-expect-error suppression on the import was unnecessary and
masked two real type holes that surfaced once it was removed:

- core.transport.getState('ctx') returns Promise<object>; cast to the
  ambient Ctx type so escExitFullscreen is read through a typed path.
- CoreTransport.on/off types listeners as () => void, but the 'NewState'
  event actually emits a string[]. Use a (...args: unknown[]) wrapper +
  Array.isArray narrowing so the call site stays type-safe without
  weakening the ambient transport signature.

No behavior change.

Made-with: Cursor
2026-04-28 00:57:53 -04:00
AK
2e13a60007 fix(fullscreen): read settings via core.transport, not useSettings
FullscreenProvider sits above the router, but useSettings() ->
useProfile() -> useModelState() requires CoreSuspenderContext which is
only provided by withCoreSuspender below the router. Mounting the
provider therefore crashed with "Cannot read properties of null
(reading 'getState')".

Switch the provider to read profile.settings.escExitFullscreen directly
from core.transport.getState('ctx') and refresh on the 'NewState' event
when 'ctx' changes. core is available via useServices(), whose provider
sits at the very top of the tree and is always reachable here.

Behavior is preserved: ESC still exits fullscreen iff the user has the
escExitFullscreen setting enabled, and updates to that setting from the
Settings tab take effect on the next ctx NewState push.

Made-with: Cursor
2026-04-27 01:56:02 -04:00
AK
b7f7a3d2ed fix(fullscreen): consume FullscreenProvider, remove per-instance state
useFullscreen is now a thin useContext consumer of FullscreenProvider,
so all callers share a single fullscreen state owned by the app root.

Why this fixes the desync bug:

stremio-router keeps multiple route layers mounted at once, and each
top-level route (Board, Discover, Library, Calendar, Addons, Settings,
Search) renders its own MainNavBars -> HorizontalNavBar -> useFullscreen.
The previous hook held local useState plus its own listeners, so each
route had an independent boolean. Entering fullscreen, then navigating
to another tab, mounted a fresh hook initialized to false; the icon
flipped back to "enter fullscreen" and clicking it re-requested
fullscreen on top of the existing one, leaving the UI unresponsive
until a route remount happened to coincide with reality.

With one provider above the router, state outlives route remounts and
listeners are attached exactly once. The hook's return tuple shape
([fullscreen, requestFullscreen, exitFullscreen, toggleFullscreen]) is
preserved, so all three call sites (HorizontalNavBar, NavMenuContent,
Player) keep working with no API change.

Also removes the legacy src/common/useFullscreen.ts and routes its
imports through stremio/common/Fullscreen (and the stremio/common
barrel for App.js / Player).

Note: MainNavBars is still rendered per-route. Lifting it to a single
app-level layout above the router is a worthwhile follow-up (eliminates
6+ duplicate mounts) but carries non-trivial CSS / useRouteFocused /
stacked-route risk and is out of scope for this PR; tracking separately.

Made-with: Cursor
2026-04-27 01:52:02 -04:00
AK
c97a9f1566 feat(app): mount FullscreenProvider at app root
Wrap the router with <FullscreenProvider> so a single provider instance
spans the whole app lifetime. The legacy useFullscreen hook is still
intact and continues to drive consumers; the provider is in place but
not yet consumed. Splitting this from the consumer cutover keeps each
commit independently buildable.

Made-with: Cursor
2026-04-27 01:50:51 -04:00
AK
60df6860d7 feat(common): add FullscreenProvider + context module
Introduce a single, app-root-owned source of truth for fullscreen state,
mirroring the existing provider pattern (ToastProvider, FileDropProvider).
The provider centralizes the fullscreenchange / win-visibility-changed /
keydown listeners and exposes the same [fullscreen, requestFullscreen,
exitFullscreen, toggleFullscreen] tuple that consumers already destructure.

Not yet wired up - both the legacy src/common/useFullscreen hook and the
new module coexist. Subsequent commits mount the provider in App.js and
switch consumers over.

Made-with: Cursor
2026-04-27 01:50:14 -04:00
Timothy Z.
e2177938d1 bump: release v5.0.0-beta.35
Some checks failed
Build / build (push) Has been cancelled
2026-04-23 20:34:56 +02:00
Timothy Z.
8188381e64 bump: stremio-translations to 1.51.0 2026-04-23 19:55:34 +02:00
Timothy Z.
ea9edc292c
Merge pull request #1223 from Stremio/feat/add-subtiles-menu-options-context-menu
Some checks are pending
Build / build (push) Waiting to run
Player: Add context menu on subtitle choice
2026-04-23 20:50:50 +03:00
Timothy Z.
881989a0e3
Merge pull request #1227 from Stremio/fix/video-scale-translations
Player: Fix video scale translations
2026-04-23 20:49:38 +03:00
Timothy Z.
0d1358d6cb fix: correctly use track for selection 2026-04-23 19:47:32 +02:00
Timothy Z.
3c417a3306 fix: correctly show the variant label instead 2026-04-23 19:40:37 +02:00
Timothy Z.
8758df2288 Merge branch 'fix/video-scale-translations' of https://github.com/Stremio/stremio-web into fix/video-scale-translations 2026-04-23 19:22:12 +02:00
Timothy Z.
08c7141e67 fix: use translation keys for video scale and hide indicator on initial load 2026-04-23 19:20:54 +02:00
Timothy Z.
c5d7cd53f1
Merge pull request #1221 from Stremio/feat/keyboard-media-key-support
Player: Add media key support
2026-04-23 20:11:36 +03:00
Timothy Z.
67ddc6228b
Merge pull request #1220 from Stremio/feat/player-add-video-scale-property
Player: Add video scale property
2026-04-23 17:22:56 +03:00
Timothy Z.
cdffeb4fdf
Merge branch 'development' into feat/player-add-video-scale-property 2026-04-23 17:20:58 +03:00
Timothy Z.
d1090032ea
Merge pull request #1219 from Stremio/feat/player-add-hdr-badge
Player: Add HDR badge
2026-04-23 17:20:17 +03:00
Timothy Z.
f579873e1b fix: don't restart stream on next-track media key when no next video
The 'next-track' media-key handler called video.setTime(0) before
checking whether a next video existed. onNextVideoRequested() no-ops
when player.nextVideo is null, but the unconditional setTime(0) had
already rewound the current stream — causing movies (which have no
next video) to restart from the beginning when the Windows next-track
media key was pressed.

Guard both calls with the same player.nextVideo check that the
navigator.mediaSession 'nexttrack' handler already uses.
2026-04-23 16:17:38 +02:00
Timothy Z.
ca37d77c2d bump: stremio-video to v0.0.77 2026-04-23 13:58:02 +03:00
Timothy Z.
d5b73f8dc2 refactor: simplify sub variant logic 2026-04-22 22:24:22 +03:00
Timothy Z.
b18df103fa refactor: simplify 2026-04-22 22:21:31 +03:00
Timothy Z.
e2d1654f49
Merge branch 'development' into feat/add-subtiles-menu-options-context-menu 2026-04-22 22:12:00 +03:00
Tim
c0be44af1e
Merge pull request #1222 from Stremio/refactor/player-media-session
Some checks are pending
Build / build (push) Waiting to run
Dev: Move media session logic to hook
2026-04-22 17:36:23 +02:00
Tim
c782303407 refactor: move media session logic to hook 2026-04-22 17:32:20 +02:00
Timothy Z.
17d823565a fix: correctly start next video from 0 2026-04-22 17:55:26 +03:00
Timothy Z.
45f8e31f1a feat: player add media key support 2026-04-22 17:42:56 +03:00
Timothy Z.
5fe4592be6 feat: player add video scale property 2026-04-22 15:31:31 +03:00
Timothy Z.
b4908574bf remove player control shadows 2026-04-22 12:47:44 +03:00
Timothy Z.
7f28b54ce8 bump: stremio-video to v0.0.76 2026-04-22 12:47:35 +03:00
Timothy Z.
85176d36a2 bump: stremio-icons to v5.10.0 2026-04-21 18:36:06 +03:00
Timothy Z.
c8592d5610 feat: use an icon for hdr badge 2026-04-21 13:22:35 +03:00
Timothy Z.
e36d15eccf feat: add hdr badge 2026-04-21 00:26:52 +03:00
Timothy Z.
5db6df4fc2
Merge pull request #1217 from Stremio/fix/subtitles-selections-issues
Some checks failed
Build / build (push) Has been cancelled
2026-04-20 17:30:27 +03:00
Timothy Z.
5580da8ecf fix: reselection loop 2026-04-20 16:57:45 +03:00
Timothy Z.
38a811ce75 bump: stremio-core-web v0.56.4 2026-04-20 16:43:56 +03:00
Timothy Z.
de78766151 bump: stremio-video to 0.0.75 2026-04-20 16:38:32 +03:00
Timothy Z.
5bc74a9da4
Merge pull request #1199 from Stremio/fix/statistics-menu-handler
Some checks are pending
Build / build (push) Waiting to run
Player: Fix statistics menu shortcut handler
2026-04-20 12:20:55 +03:00
Timothy Z.
fe651a2cca
Merge pull request #1198 from Stremio/fix/blur-window-cancel-shortcut-events
Player: Fix cancel shortcut events on blur
2026-04-20 12:20:47 +03:00
Timothy Z.
377d57cf16
Merge pull request #1197 from Stremio/fix/correctly-select-embedded-subs-first
Player: Prioritize embedded subs first
2026-04-20 12:20:35 +03:00
Timothy Z.
965feed67b feat: impl context menu on subtitle choice 2026-04-20 12:17:52 +03:00
Timothy Z.
694fb833aa fix: statistics menu handler 2026-04-17 21:03:11 +03:00
Timothy Z.
f74f9aafa0 fix: on blue cancel shortcut events 2026-04-17 20:53:48 +03:00
Timothy Z.
bbfe25177b fix: prioritize embedded subs first 2026-04-17 17:38:31 +03:00
Timothy Z.
5560813b37
Merge pull request #1196 from Stremio/fix/space-bar-events-play-pause-handing
Some checks failed
Build / build (push) Has been cancelled
2026-04-16 12:27:02 +03:00
Timothy Z.
8fcffa2c3e Update Player.js 2026-04-16 12:17:22 +03:00
Timothy Z.
3e93afbe21 fix: space bar holding issues 2026-04-16 12:13:48 +03:00
Timothy Z.
81fdb18536 bump: release v5.0.0-beta.34
Some checks failed
Build / build (push) Has been cancelled
2026-04-15 00:47:24 +03:00
Timothy Z.
5e8db65551
Merge pull request #1194 from Stremio/fix/subtitles-grouping-logic
Player: Use combination of set with map to avoid crashes on SubtitlesMenu
2026-04-15 00:45:47 +03:00
Timothy Z.
a322de9093 fix: use set with map to avoid crash on older devices 2026-04-14 21:34:10 +03:00
Tim
35970825fa
Merge pull request #1179 from ignaciojsoler/feat/persist-subtitle-language
Some checks are pending
Build / build (push) Waiting to run
fix: persist subtitle language preference across streams
2026-04-14 13:16:39 +02:00