Skip to content

Add Stop session to the streaming Back menu - #4

Merged
mlopezsegura merged 3 commits into
OpenstreamCo:masterfrom
luisotavio-dev:stop-session
Oct 30, 2026
Merged

mlopezsegura merged 3 commits into
OpenstreamCo:masterfrom
luisotavio-dev:stop-session

Conversation

@luisotavio-dev

@luisotavio-dev luisotavio-dev commented Oct 27, 2026 •

Copy link
Copy Markdown

Motivation

On my Samsung QN50Q60C (Tizen 9) the stock remote has no easy way to press Options, so the only place that offers Stop session — the running application's menu on the app list — is hard to reach. In practice I could only end a session by trying to launch a different app and accepting the "Stop & Launch" dialog.

This is the remote that ships with the Q60C:

Samsung Q60C remote

Since the Back menu is what you naturally open when you are done playing, putting Stop session there makes it easy to end the session from any remote or gamepad.

What it does

  • The Back menu while streaming gets a Stop session item, below the existing Stop streaming. It sends stop-host-session.
  • The TV leaves the stream immediately, as Stop streaming does, and returns to the application list instead of sitting on a frozen picture. The host stop takes a few seconds (most of it waiting for Sunshine to report idle).
  • While the PC closes the application, a busy toast with a spinner ("Stopping session — Closing on the PC") stays on screen. When host-session-status reports stopped it is replaced by the usual "Session stopped".
  • Until the host confirms the stop, gamepad and remote input are ignored, so nothing can be launched or opened mid-stop. The application's card keeps its Running badge until the stop is confirmed.
  • If no host status arrives within 30 s, the toast and the input hold clear and the list is refreshed, so the UI never gets stuck.
  • TizenUi.showToast accepts { busy: true }. It adds a spinner, skips the automatic dismissal and returns the toast element for the caller to remove. Existing calls are unchanged.

The server ends the stream of a host stop without sending an idle session status (stop_stream(connection, false) followed by host-session-status: stopped in patches/0004-webrtc-module.patch). That is why the TV now closes the player itself rather than waiting for idle. Session statuses that arrive during the stop are ignored.

One open question: one button or two?

I wasn't sure whether to change the existing Stop streaming button or add a new one. I didn't know whether its disconnect-only behaviour, which leaves the app running so it can be resumed later, is something people rely on, so I kept it as it is and added a separate button for now. If you'd rather have a single button, I'm happy to unify them, for example by making Stop streaming also stop the host session, or by asking which one the user wants.

Testing

  • I used it day to day on the QN50Q60C (Tizen 9). My setup is the Gateway-era client (f304999) with the Gateway, streaming from Vibeshine, a Sunshine fork. The behaviour above was checked on the TV there.
  • For this PR the three commits were cherry-picked onto master. The only conflict was the stream-menu line in index.html, where I kept the new "Show performance overlay" button.
  • All 15 tests/Tizen*Test.js pass on this branch. TizenUiTest.js gains checks for the new menu item, the busy toast, the player closing on stopped/failed, and the input hold.
  • I have not run this branch against Sunshine-Web-RTC on a TV, because my host isn't running it. The flow relies only on the stop-host-session / host-session-status messages, which Sunshine-Web-RTC sends in the same order as the Gateway.

🤖 Generated with Claude Code

luisotavio-dev and others added 3 commits October 27, 2026 13:07
The Back menu while streaming only offered "Stop streaming", which ends the
local stream but leaves the application running on the PC, so the next
connection resumes it. "Stop session", below it, sends stop-host-session:
the Gateway ends the stream, cancels the Sunshine application and reports
the host session as stopped.

The Gateway ends the stream of a host stop without an idle session status,
so the TV now closes the player and returns to the application list when
that stopped (or failed) host status arrives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 651c72e)
Stop session kept the player open until the PC confirmed that the
application had closed, which takes a few seconds and left the user stuck
on a frozen stream. The TV now sends stop-host-session, leaves the stream
at once as Stop streaming does, and returns to the application list while
a busy toast ("Stopping session", with a spinner) stays until the host
reports the stop. Session statuses that arrive meanwhile are ignored, and
the toast clears after 30 s if no host status comes.

TizenUi.showToast accepts { busy: true }: it adds a spinner, skips the
automatic dismissal and returns the toast element for the caller to remove.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 12c82e3)
While the PC closes the application (about ten seconds, most of it the
Gateway waiting for Sunshine to report idle), the TV now ignores gamepad
and remote input, so nothing can be launched or opened mid-stop, and the
stopped application's card keeps its Running badge until the host
confirms the stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 7997751)
@mlopezsegura
mlopezsegura merged commit 6b0b40f into OpenstreamCo:master Oct 30, 2026
2 checks passed
@mlopezsegura mlopezsegura mentioned this pull request Oct 30, 2026
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