# Browser login and stream settings

This frontend refresh ships in **Browser Preview 8**, building on Preview 7's
compatible-profile negotiation. The frontend is embedded in the bundled helper;
install the matching browser-enabled Host package, then reload the browser page.

## Sign in

The sign-in card identifies the Host address from the page's actual origin and
asks for a **Maximizer Host streaming account**. The help disclosure explains
where the Host administrator creates accounts and resets passwords. It does not
imply that this browser page provides account creation or password recovery.

Username and password have persistent labels and stable `name`/`autocomplete`
attributes for password managers. Paste and ordinary Enter-to-submit work. The
Show/Hide button is a separate, keyboard-operable action; passwords are remasked
when submitted and cleared on successful sign-in/sign-out. Caps Lock feedback is
shown while editing the password. Credentials and session tokens are not added to
browser storage by this refresh. The form uses POST and the sign-in button stays
disabled until JavaScript and the required browser features are available.

Signing in shows a busy label and prevents duplicate submissions. Errors appear
beside the sign-in controls with an alert role and keyboard focus. After success,
focus moves to the Stream settings heading. Unsupported browsers get an explicit
feature message; users without JavaScript get an explanation rather than an
apparently working form.

## Set up a stream

- **Application:** choose an application returned by the Host. An empty list
  explains how to add an application and disables Start streaming.
- **Picture quality:** resolution, frame rate and bitrate remain immediately
  available, with units and short explanations. The initial choices remain
  1920×1080, 60 FPS and a 15 Mbps target.
- **Bitrate reduction:** remains an explicit, unchecked choice. Its effect on
  visible detail is explained alongside the control. Resolution stays fixed.
- **Advanced settings:** a native expandable section holds video-profile and
  decoder preferences. Automatic compatibility and hardware-preferred automatic
  decoding remain the initial choices. The complete profile ladder and the
  distinction between a preference and an actual backend are explained.
- **Your next stream:** reflects the form's current application, resolution,
  frame rate, bitrate target, video/decoder preferences and congestion choice.
  These are requested settings, not invented throughput or decoder measurements.
  Display output is explicitly 8-bit SDR.

Start streaming retains the existing session request and negotiation flow. Form
choices are disabled during connection setup so they cannot diverge from the
in-flight request. Disconnect/failure restores them, retaining the selected
values. Both the normal start and compatible-stream retry validate the form.
The controller help is shown after sign-in; existing player controls, canvas
handoff, decoder diagnostics and input handling retain their IDs and routes.

## Fullscreen capture and saved preferences (Browser Preview 9)

Browser Preview 9 adds automatic mouse capture in fullscreen and opt-in saved
stream preferences to the Preview 8 interface.

### Fullscreen and mouse control

The player's **Fullscreen** button requests mouse capture and fullscreen from the
same click. Pointer lock is requested first because fullscreen consumes transient
user activation. The combined request uses standard relative mouse movement so
an unsupported raw-input option cannot consume the opportunity to capture. A
separate Capture mouse action or a recapture click still prefers raw movement,
with ordinary pointer lock as the supported fallback.

The fullscreen element is now a stage containing the video and local controls.
When capture is released or denied, **Capture mouse**, **Exit fullscreen** and
**Disconnect** remain available inside fullscreen. Clicking the video recaptures
the mouse; that first click is consumed locally rather than clicking the remote
desktop or firing in a game. Windowed desktop input continues to use the normal
absolute pointer until Capture mouse is selected.

| Shortcut | Action |
| --- | --- |
| Ctrl+Alt+Shift+M | Capture or release the mouse |
| Ctrl+Alt+Shift+F | Enter or leave player fullscreen |
| Ctrl+Alt+Shift+Q | Disconnect |
| Ctrl+Alt+Shift+S | Show or hide stream stats |

Where keyboard lock is supported and allowed, a short Escape can reach the game;
hold Escape to use the browser's fullscreen/capture exit gesture. Without keyboard
lock, Escape may release capture or exit fullscreen immediately. Keyboard lock is
optional: denying it does not prevent fullscreen or mouse capture. Browser F11
fullscreen is separate from the player's Fullscreen action.

Mode changes reset held keys/buttons and pending mouse work. Exiting fullscreen,
disconnecting or replacing a stream retires its owned capture. No mode-change or
focus event automatically recaptures after the user releases the mouse. Late
grants from a retired session are closed without applying that session's intent
to a new canvas. Capture failures are reported inside the fullscreen stage.

References: [MDN requestPointerLock](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestPointerLock)
and [MDN requestFullscreen](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen),
reviewed 2026-10-28. Both Promise and event-only pointer-lock implementations are
handled; the browser's permission and user-activation requirements still apply.

### Readable stream stats and windowed size (Browser Preview 12)

The browser's stats now sit in their own strip **below the windowed picture**,
not among the playback buttons. In player fullscreen they become a compact
**top-right HUD**. Stream FPS, control RTT and measured encoded-video bitrate are
prominent. **Stream details & diagnostics** expands the remaining counters,
individual timings, encoder/requested targets, codec and decoder/audio details.
The live values are not announced continuously to screen readers.

**Hide stats / Show stats** and **Ctrl+Alt+Shift+S** work locally, including in
fullscreen; the shortcut is not sent to the Host. Hiding the panel closes its
details and returns disclosure focus to the relevant toggle. The visibility choice
lasts only for this visit, without adding anything to saved stream preferences.
Disconnect/reconnect clears previous measurements and closes diagnostics. Missing
or invalid measurements show **—**, not an invented zero. Video data is measured
encoded-video Mbps, not the configured target or total network throughput. Control
RTT, decode/output and draw submission remain separate timings, not a sum presented
as total input-to-screen latency. Decoder preference is not actual-backend proof.

Outside player fullscreen, resize the play area with **− Smaller**, **+ Larger**,
or the **lower-right drag handle**. **Reset size** returns to a default capped at
1280 CSS pixels, fitted to the available width and height so the compact stats
remain visible where space permits. Deliberately enlarging can require vertical
page scrolling. Picture proportions are preserved; the maximum is the available
page width, with a 320-pixel minimum (or the available width on narrower pages).

The focusable, labelled resize handle also accepts arrow keys in 32-pixel steps,
Shift+arrows in 100-pixel steps, Home for minimum and End for maximum. Dragging
cancels on pointer cancellation, lost capture or focus loss. Size controls are
disabled during player fullscreen or mouse capture; release capture to resize.
The selected windowed width survives entering and leaving fullscreen during the
visit. Resizing changes **only the local display**: it never restarts the stream,
changes encoded canvas dimensions or sends a different resolution/quality request.

This browser-only design follows the compact/optional-detail approach described
by [NVIDIA's official overlay overview](https://www.nvidia.com/en-us/geforce/news/nvidia-app-download-and-features/)
(selectable stats, position and size) and the progressive-detail idea in
[Steam's performance-monitor guidance](https://help.steampowered.com/en/faqs/view/3462-CD4C-36BD-5767).
The NVIDIA article was readable online; the Steam page's article body was not
available to the research fetch, so its detail-level reference relies on search
snippets, not a verified full article. Native `<details>/<summary>` follows the
[W3C disclosure pattern](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/).
These references informed the browser layout; the native Maximizer app is unchanged.

Verification on the designated isolated server passes **111 JavaScript tests**,
**17 Chrome UI scenarios**, **10 native Chrome interaction scenarios**, and **10
axe audits** with zero violations or incomplete checks. Native fullscreen is
verified against the X11 window state and 1440×1000 window/page/stage dimensions,
not just `document.fullscreenElement`. Linux/Windows helper compilation, Go vet,
the Go regression suite and exact embedded frontend bytes pass. Authentication,
media and stats are synthetic in these UI fixtures: this is not a new real-stream,
physical-device, cross-platform or published-package acceptance result. The
changes ship in Browser Preview 12 (1.0.268+browser.12), building on Browser Beta 2.
Install the matching complete Host package and reload the page.

### Average-client interface refinement (Browser Preview 13)

The browser-only refinement simplifies setup while retaining the complete settings
and streaming behavior. **Recommended** presents 1080p, 60 FPS and 15 Mbps as a
starting point; **Custom** reveals the existing resolution, frame rate and bitrate
controls. Recommended is only a presentation preset: it never silently overwrites
an explicitly restored custom preference record. Congestion reduction remains an
explicit opt-in, and automatic compatibility/decoder preferences retain their
defaults. The original start request and profile-negotiation flow are unchanged.

Application and picture choices share one setup card. Compatibility, preferences
and congestion details use **More settings**, while the start summary keeps its
own optional **Connection details**. This is progressive disclosure, not removal
of controls. Every existing field retains its ID, label, validation and semantics.
Spacing, typography, 10–14-pixel control radii and familiar labels replace the
numbered cards for a more consistent visual hierarchy.

The desktop windowed toolbar puts Fullscreen and mouse capture first, local sizing
next, then Show/Hide stats and **More → Disconnect stream**. It fades after 2.2
seconds of inactivity outside pointer/focus areas. Requested controls reappear
immediately on movement, keyboard shortcuts or Tab; only the idle fade-out is
animated. Hidden controls leave the tab order; disclosure and focus are retained
while More is open. Fullscreen retains its existing capture, exit,
disconnect and top-right stats interface. Playback and resizing guidance remains
available in a native disclosure. No local toolbar/menu action is sent to the Host.

These choices follow the familiar-hierarchy and progressive-disclosure guidance
from [W3C](https://www.w3.org/WAI/WCAG2/supplemental/patterns/o1p02-familiar-design/)
and [Nielsen Norman Group](https://www.nngroup.com/articles/progressive-disclosure/),
consulted 2026-10-30. Acceptance additionally covers Recommended/Custom exact-request
behavior, toolbar focus restoration, More/Escape/disconnect, 320–3840 CSS pixels,
200% text and forced colors. The native Maximizer app, stream resolution, quality,
bitrate, capture, audio and protocol are not changed by this presentation work.
Install the matching complete Browser Preview 13 package and reload the page.

### Clear connection progress and recovery (Browser Preview 14)

Startup reports three observed milestones rather than a synthetic percentage:
**Contacting Host → Preparing video → Streaming**. Contacting Host covers local
capability checks and the Host reservation request. Preparing video begins only
when a reserved session starts its renderer/transport work and continues until
the first picture is presented. Streaming begins only on the worker's existing
`playing` event. Profile fallback remains part of this flow and does not change
resolution, frame rate, bitrate target, input, native-app or OpenStream behavior.

**Cancel** is available throughout startup. It uses the existing generation and
abort paths, releases any late reservation, restores the retained form values and
does not attach a stale player. No automatic retry or automatic-timeout change is
introduced.

Failures use a dedicated recovery view with a plain-language explanation, **Try
again**, **Back to settings**, and an expandable **Technical details** section.
Try again repeats the same normal/compatible route and current settings; Back to
settings retains the same application and stream choices. The technical view
records the last observed stage, Host and error code when available, with the
current session token and stream ticket redacted. A Host session expiry instead
returns to sign-in without offering a retry that cannot authenticate.

`browser/web/connection-recovery.js` holds the shared stage and error mapping;
`browser/tests/connection-recovery.test.js` covers it. The browser fixture also
exercises held startup, first-picture completion, preparing failure, retry,
cancellation, authentication expiry, focus and narrow recovery layout with
synthetic API/media boundaries. Existing worker and negotiation timeouts remain
unchanged.

Final local verification passes **119 JavaScript tests**, **23 Chrome UI
scenarios**, **10 native Chrome/X11 scenarios**, and **11 axe audits** with zero
violations or incomplete checks. Linux/Windows helper compilation, Go vet, the Go
regression suite and exact embedded frontend bytes also pass. The new progress
and recovery captures were reviewed at desktop and 390 pixels. These are
private synthetic UI/media results, not a new live-stream, physical-device,
cross-platform or published-package acceptance claim.
Install the matching complete Browser Preview 14 package and reload the page.

### Plain-text clipboard paste (corrected in Browser Preview 16)

Browser uploads/downloads and the Transfers panel ship in **Browser Preview 17**;
see [`browser-file-transfers.md`](browser-file-transfers.md) for setup, save behavior
and limits. Existing Host transfer opt-ins and configured roots are not changed.

The browser now matches the native app's one-way Client → Host clipboard flow.
Use **Paste text** in More or **Ctrl+Alt+Shift+V**. Clipboard access requires an
explicit action and a focused page; denied/unavailable clipboard permission opens
an explicit manual text fallback. A valid authenticated ready receipt is required
before the returned paste gesture is synthesized. Focus loss, intervening input,
timeout, disconnect and stale sessions cannot paste. No clipboard text is saved or
included in recovery details. Host-to-Client clipboard reading is not implemented;
there is no existing native Host clipboard-read protocol to reuse. See
`browser-clipboard.md` for protocol, limits and verification scope.
Install the matching complete Browser Preview 16 package and reload the page.
Preview 16 fixes the original Preview 15 key-ordering defect: the paste key now
follows its modifiers, and ordinary modifier-key releases are no longer swallowed.
The **Paste sent to Host** status confirms publication and gesture dispatch, not
an application-level insertion acknowledgement.

### Remember stream settings

Enable **Remember settings on this browser** to save the current resolution,
frame rate, bitrate target, video-profile preference, decoder preference and
congestion-reduction choice. Subsequent valid edits save automatically. Saved
choices restore when the page is opened again, including after a browser restart.
They are shared by streaming accounts using this browser profile and Host origin
(scheme, address and port); another browser/device or Host origin has its own data.

**Forget saved settings**, or unchecking Remember, deletes only this feature's
record. The current selections remain usable for the current visit. Clearing the
record in another tab also turns off automatic saving here. Another tab's saved
values never change an active stream or overwrite the current form.

The versioned local-storage record contains only the six allowlisted preferences.
It contains no username, password, authentication token, session ticket or app ID.
Restoring preferences does not sign in, start a stream or enter fullscreen. No data
is stored until Remember is selected. Browser private mode or cleared site data
can remove saved preferences.

Validation rejects unknown versions, malformed/oversized records, unsupported
options and invalid numeric values without silently clamping them. An invalid
edit retains the previous valid saved choices and displays an unsaved message.
Storage access, quota, write/readback and deletion failures produce visible
feedback while leaving ordinary sign-in and streaming available.

## Playback guide and Sunshine Stereo (Browser Preview 10)

The settings page puts common choices first: application, picture quality, saved
preferences, then optional advanced settings. On desktop, **Your next stream**
stays visible while the form scrolls. A visible **Fullscreen & playback controls**
panel lists the playback shortcuts and explains automatic capture, release/recapture,
and holding Escape when keyboard lock is active. The panel is not hidden behind a
tooltip or an expandable section.

The summary includes **Audio capture: Sunshine Stereo**. The decoder details report
the same source from the session's ready metadata. Browser sessions now disable
Host playback and use the virtual Sunshine Stereo capture path instead of the HDMI
sink selected by the earlier Host-playback flag. This matches the native client's
usual capture path without introducing a separate browser audio format.

These changes ship in **Browser Preview 10**. Install the matching browser-enabled
Host package and reload the browser page.

The development source passes 96 JavaScript checks, the C++ browser protocol
checks, 13 Chrome 156 UI scenarios and eight axe audits with zero violations or
incomplete checks. Desktop, narrow, advanced and forced-colors screenshots were
reviewed. The matching candidate Host also passed the Sunshine Stereo sink,
monitor, audio/reconnect and restoration checks described in `browser-audio.md`.
This remains controlled verification, not a published-package or broad-platform
qualification.

## Design and accessibility approach

The layout uses the Maximizer navy/mint palette, system fonts and local assets.
Desktop sign-in has a compact explanatory panel beside the form; narrow layouts
prioritize the form. Settings use grouped fields and a summary beside them, then
reflow into one column. Advanced options are disclosed on demand; essential
quality choices and the Start streaming action remain directly discoverable.

Controls have visible focus outlines, native semantics and explicit labels/help
associations. Related inputs use `fieldset`/`legend`. Main controls and disclosure
targets are at least 44 CSS pixels high; the checkbox has a large associated label.
Status/error text conveys state independently of color. The page supports reduced
motion, forced colors, text resizing and narrow-width reflow. There are no
third-party fonts, runtime scripts, tracking pixels or UI framework dependencies.

These choices are informed by the following guidance, checked online on
2026-10-28 UTC:

1. [web.dev: Sign-in form best practices](https://web.dev/articles/sign-in-form-best-practices)
   — native forms, stable autofill attributes, visible labels, password visibility,
   clear submission feedback and usable mobile targets.
2. [W3C WAI: Forms tutorial](https://www.w3.org/WAI/tutorials/forms/)
   — concise forms, labelled controls, field grouping and useful instructions.
3. [W3C WAI: User notifications](https://www.w3.org/WAI/tutorials/forms/notifications/)
   — understandable errors, nearby feedback, live regions and focus management.
4. [WCAG 2.2: Target Size (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)
   — the AA minimum is 24×24 CSS pixels or its specified exceptions; the design
   aims above that minimum with 44–48 pixel primary targets.
5. [GOV.UK Design System: Details](https://design-system.service.gov.uk/components/details/)
   — reveal secondary information on demand without hiding essential form fields.

Following these patterns and automated audits is not a claim of complete WCAG
conformance or physical-device/screen-reader certification.

## Verification

`browser/tests/ui-smoke.mjs` serves the actual frontend under the helper's Content
Security Policy. It uses Playwright and axe-core with synthetic API responses and
media boundaries. It never authenticates to a live Host or opens a real stream.
Run it in the designated isolated runtime environment with:

- `PLAYWRIGHT_MODULE`: absolute path to Playwright's `index.mjs`;
- `CHROME_EXECUTABLE`: the test browser executable;
- `AXE_SCRIPT`: a verified local axe-core script;
- `BROWSER_WEB_ROOT`: the `browser/web` directory;
- `UI_OUTPUT_DIR`: a fresh writable results directory.

```sh
node browser/tests/ui-smoke.mjs
```

The suite covers keyboard/Enter/password visibility, required fields, busy and
error feedback, unsupported/no-JavaScript cases, empty/long application names,
summary/request correspondence, pending-field locking, reconnect preservation,
validation on both start routes and logout during a pending start. Layout checks
span 320–3840 CSS pixels, 200% text and forced colors, with screenshots and axe
WCAG 2 A/AA, 2.1 AA, 2.2 AA and best-practice checks. The existing Node test suite
separately covers media/profile/input/audio logic. Physical playback and native
platform qualification remain separate from this frontend fixture.

`browser/tests/preferences.test.js` and `player-controls.test.js` cover storage
failure/validation/allowlisting and asynchronous mode ownership, denial, fallback,
escape and stale-grant behavior. `ui-smoke.mjs` also exercises opt-in/reload,
cross-tab removal, invalid storage and unavailable storage through the real forms.

`browser/tests/session-ui.mjs` requires a private native X11 display/window manager,
`CHROME_PROFILE`, and the same browser/module/web/output variables. It launches
Chrome directly and attaches CDP, explicitly disabling focus/viewport emulation
(older Playwright versions ignore `noDefaults`). It does not substitute DOM state
for native fullscreen. Native window-manager state,
window dimensions, actual pointer lock, relative input, release/recapture,
disconnect/reconnect, long Escape and a complete browser restart are checked.
Its authentication/media are synthetic, permissions are explicitly granted, and
one capture-denial case is injected at the API boundary. Do not treat that injected
case as acceptance of every browser's physical permission prompt.

For Playwright 1.56.1, the native test needs an isolated driver copy with the
`Emulation.setFocusEmulationEnabled` default in `lib/server/chromium/crPage.js`
changed from `true` to `false`. That emulation is scoped to the driver's CDP
session: disabling it from another CDP session is insufficient. The layout
campaign records exact before/after driver hashes and retains the original driver.
Only this test-only default changes; all native window-state/dimension assertions
and actual browser APIs remain intact. A newer driver with a functioning
non-emulating `noDefaults` path can be used instead. Do not patch product code or
weaken the native assertions to accept DOM-only fullscreen.
