Repository navigation
Add Stop session to the streaming Back menu - #4
Merged
Merged
Conversation
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)
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
stop-host-session.host-session-statusreportsstoppedit is replaced by the usual "Session stopped".TizenUi.showToastaccepts{ 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
idlesession status (stop_stream(connection, false)followed byhost-session-status: stoppedinpatches/0004-webrtc-module.patch). That is why the TV now closes the player itself rather than waiting foridle. 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
f304999) with the Gateway, streaming from Vibeshine, a Sunshine fork. The behaviour above was checked on the TV there.master. The only conflict was the stream-menu line inindex.html, where I kept the new "Show performance overlay" button.tests/Tizen*Test.jspass on this branch.TizenUiTest.jsgains checks for the new menu item, the busy toast, the player closing onstopped/failed, and the input hold.stop-host-session/host-session-statusmessages, which Sunshine-Web-RTC sends in the same order as the Gateway.🤖 Generated with Claude Code