Skip to content

Fix black screen: subscribe to Media Gateway streams via live mode#2

Open
jajajhhz wants to merge 2 commits into
Edgenesis:mainfrom
jajajhhz:fix/live-mode-media-gateway
Open

Fix black screen: subscribe to Media Gateway streams via live mode#2
jajajhhz wants to merge 2 commits into
Edgenesis:mainfrom
jajajhhz:fix/live-mode-media-gateway

Conversation

@jajajhhz

@jajajhhz jajajhhz commented Jun 1, 2026

Copy link
Copy Markdown

Problem

The /video viewer connects to the channel and authenticates, but renders a black screen — the console shows 🔄 Remote users updated: 0 indefinitely; it never sees the camera.

Root cause

agora-config.ts hard-codes the client as mode: 'rtc' (communication profile). But the SS Rover cameras are pushed into Agora via Media Gateway (RTMP rtls-ingress / SRT), which join the channel as live-broadcast hosts. An rtc/communication-mode client cannot subscribe to live-broadcast hosts, so remoteUsers stays empty and nothing renders.

Verified against the live ssrover channel: the camera (uid 1001) is broadcasting (confirmed via the Agora REST channel API), the viewer joins successfully, but logs Remote users updated: 0.

Fix

  • Create the client in live mode.
  • Call setClientRole(audience | host) before join() (viewers = audience, publishers = host), which live mode requires.

Minimal behavioural change; no API/prop changes. The publisher path keeps working (joins as host).

Test

After deploy, open:

/video?appId=<id>&cert=<cert>&channel=ssrover&uid=2

→ the viewer should now subscribe to uid 1001 and show the camera feed.

🤖 Generated with Claude Code

jajajhhz and others added 2 commits June 1, 2026 16:34
The viewer hardcoded createClient({ mode: 'rtc' }). Streams injected by
Agora Media Gateway (RTMP/SRT ingest, e.g. the deviceShifu cameras) join
the channel as live-broadcast hosts, which an rtc/communication-mode
client cannot see — so remoteUsers stays 0 and the page renders black.

Switch to live-broadcast mode and set the client role before joining
(audience for viewers, host for publishers) so the viewer subscribes to
the camera's video track.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A string uid (e.g. from a URL query param) makes the SDK join in
user-account mode, where the client does not receive the Media Gateway
host's published stream — another cause of the black screen. Join with
an integer uid when the value is numeric.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant