Skip to content

feat(screen-share): let users choose which screen or window to share - #238

Open
tonyco97 wants to merge 3 commits into
mainfrom
issue_8113
Open

tonyco97 wants to merge 3 commits into
mainfrom
issue_8113

Conversation

@tonyco97

Copy link
Copy Markdown
Collaborator

@tonyco97 tonyco97 self-assigned this Oct 12, 2026
@tonyco97
tonyco97 marked this pull request as ready for review October 12, 2026 16:09
@github-actions

Copy link
Copy Markdown

Automatic builds from https://github.com/NethServer/nethlink/actions/runs/38275087804.
Commit: 21d13ed

Name Platform Link
win-app.exe Windows (x64) Link
macos-app-x64.dmg MacOS (x64) Link
macos-app-arm64.dmg MacOS (arm64) Link
linux-app.AppImage Linux (x64) Link

@tommaso-ascani tommaso-ascani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments.

Comment thread src/main/classes/controllers/ScreenSharePickerController.ts
Comment thread src/main/classes/controllers/ScreenSharePickerController.ts Outdated
callback({ video: { id: source.id, name: source.name } })
} else {
Log.info('SCREEN SHARE request cancelled')
callback(null as unknown as Electron.Streams)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callback(null) surfaces as NotReadableError; phone-island doesn't clean up the Janus room/handle on that path.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed, but the root cause is in phone-island and predates this PR. The createOffer error callback in VideoView only resets the store and never calls plugin.detach(), so the videoroom handle and the created room leak on any getDisplayMedia failure, including Cancel in the browser picker on CTI web (the rejection type, NotReadableError vs NotAllowedError, makes no difference there). This PR turns Cancel into a regular path in NethLink, so it shows up more often. We will open a dedicated issue to fix it in phone-island (release the handle on that error path) and then bump phone-island here. Working around it from NethLink with phone-island-screen-share-stop is not viable: stopScreenShare() sends screenSharingStop to the remote user, whose island would switch to the video view for a share that never started.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracked in NethServer/dev#8237 and fixed in nethesis/phone-island#292 (c5f4cfc): when the publisher createOffer fails (picker cancelled or capture error), phone-island now destroys the room it created and detaches the videoroom handle. We will bump phone-island in NethLink once it is released; leaving this thread open until then.

Comment thread src/main/classes/controllers/ScreenSharePickerController.ts
@github-actions

Copy link
Copy Markdown

Automatic builds from https://github.com/NethServer/nethlink/actions/runs/38701845970.
Commit: 5456e28

Name Platform Link
win-app.exe Windows (x64) Link
macos-app-x64.dmg MacOS (x64) Link
macos-app-arm64.dmg MacOS (arm64) Link
linux-app.AppImage Linux (x64) Link

@tommaso-ascani tommaso-ascani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fullscreen and focus fixed, thanks. Two left inline.

Comment thread src/main/classes/controllers/ScreenSharePickerController.ts Outdated
callback({ video: { id: source.id, name: source.name } })
} else {
Log.info('SCREEN SHARE request cancelled')
callback(null as unknown as Electron.Streams)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cancel still leaves the Janus room/publisher open in phone-island.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same root cause discussed in the thread above: the createOffer error callback in phone-island VideoView resets the store but never releases the videoroom handle and the room. It predates this PR and also happens on CTI web when the user cancels the browser picker, so it cannot be fixed from NethLink without side effects (phone-island-screen-share-stop would send screenSharingStop to the remote user). We will track it in a dedicated phone-island issue and bump phone-island here once it is released; we would prefer not to block this PR on it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracked in NethServer/dev#8237 and fixed in nethesis/phone-island#292 (c5f4cfc): when the publisher createOffer fails (picker cancelled or capture error), phone-island now destroys the room it created and detaches the videoroom handle. We will bump phone-island in NethLink once it is released; leaving this thread open until then.

@github-actions

Copy link
Copy Markdown

Automatic builds from https://github.com/NethServer/nethlink/actions/runs/38754732657.
Commit: 4efbe56

Name Platform Link
win-app.exe Windows (x64) Link
macos-app-x64.dmg MacOS (x64) Link
macos-app-arm64.dmg MacOS (arm64) Link
linux-app.AppImage Linux (x64) Link

@github-actions

Copy link
Copy Markdown

Automatic builds from https://github.com/NethServer/nethlink/actions/runs/38759535842.
Commit: 8439c36

Name Platform Link
win-app.exe Windows (x64) Link
macos-app-x64.dmg MacOS (x64) Link
macos-app-arm64.dmg MacOS (arm64) Link
linux-app.AppImage Linux (x64) Link

This branch has not been deployed

No deployments
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