Skip to content

fix: add Linux camera browser fallback - #289

Merged
FabienDanieau merged 3 commits into
pollen-robotics:developfrom
kamjin3086:fix/linux-camera-browser-fallback
Jul 6, 2026
Merged

fix: add Linux camera browser fallback#289
FabienDanieau merged 3 commits into
pollen-robotics:developfrom
kamjin3086:fix/linux-camera-browser-fallback

Conversation

@kamjin3086

@kamjin3086 kamjin3086 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

This PR extracts the Linux camera fallback work from #283, following the request to split it from the Fedora RPM packaging changes.

Summary:

  • detect desktop WebViews that do not expose RTCPeerConnection
  • show an external browser fallback action for the camera stream
  • add a Tauri command that writes and opens a temporary browser-based camera viewer
  • keep this PR free of RPM/release workflow changes

Validation:

  • cargo check -q
  • yarn --ignore-engines typecheck
  • yarn --ignore-engines lint (passes with existing repository warnings only)
  • git diff --check

Notes:

  • While splitting the PR, I added the missing GstWebRTCProducer.meta type so the branch passes TypeScript checking.

@kamjin3086

kamjin3086 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Update: I installed the missing Fedora development packages locally and reran the checks. cargo check -q now passes for this branch, so I removed the previous environment-blocked note and updated the PR description with the full validation list.

@FabienDanieau FabienDanieau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Super nice, it's really useful. I've left some comments.

Comment thread src-tauri/src/lib.rs
Comment thread src/views/active-robot/camera/CameraFeed.tsx Outdated
@kamjin3086

Copy link
Copy Markdown
Contributor Author

Thanks for the review, I updated the PR to address both points:

  • The external browser camera page now embeds and uses the existing src/lib/gstwebrtc-api.js helper instead of manually duplicating the signaling / WebRTC session logic.
  • The camera fallback display now also relies on the shared isWebRTCAvailable state, while still limiting the browser fallback button to the desktop WebView unsupported case.

I reran the local checks after the change:

  • cargo fmt --check
  • cargo check -q
  • yarn --ignore-engines typecheck
  • yarn --ignore-engines lint (passes with the existing warnings)

Let me know if you would prefer the external viewer glue to be factored further, but this should now avoid the duplicated low-level WebRTC logic.

@FabienDanieau FabienDanieau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a minor refacto and we can merge!

const errorIconColor = `${STATUS.error}99`;
const errorTextColor = `${STATUS.error}b3`;
const canOpenExternalViewer =
isWebRTCAvailable === false && error === 'WebRTC is not supported by this desktop WebView';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@kamjin3086

Copy link
Copy Markdown
Contributor Author

Thanks, fixed in the latest commit.

I exported the existing WEBRTC_UNSUPPORTED_MESSAGE constant from WebRTCStreamContext and now compare against that in CameraFeed instead of duplicating the literal string.

I reran the checks locally:

  • yarn --ignore-engines typecheck
  • yarn --ignore-engines lint (passes with the existing warnings)
  • cargo fmt --check
  • cargo check -q

Thanks again for the review!

@FabienDanieau

Copy link
Copy Markdown
Contributor

Thanks! Let's merge

@FabienDanieau
FabienDanieau merged commit 0f15097 into pollen-robotics:develop Jul 6, 2026
2 checks passed
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