Add transparent background rendering - #218
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Summary
transparentBackgroundclient/session optionPreview integration
The Lab preview pins the attached deterministic SDK tarball rather than relying on an unpublished npm tag.
Verification
npm run buildKnown POC constraints
stream()returns the opaque green source; transparency is canvas-onlySummary by cubic
Adds transparent avatar background rendering via a WebGL overlay and a packed, premultiplied color+alpha H.264 stream. The packed path uses server‑feathered alpha; the client only clears the decoder black pedestal, clamps RGB to alpha, and calibrates the legacy key to the decoded carrier to avoid a faint veil.
New Features
packed-alpha-v2whenMediaCapabilitiesreports supported+smooth in both orientations; otherwise falls back to an adaptive chroma key that auto‑detects green or blue and calibrates to the decoded border. Promotes H.264 to Main Level 4.0 on initial offers and ICE restarts; emitsclient_transparent_renderertelemetry.getTransparentBackgroundCanvas()returns the composited canvas. Supports vertical and horizontal packed layouts; shuts down the session if the local renderer can’t initialize.Migration
transparentBackground: true, then callstreamToVideoElementon a DOM‑attached<video>withautoplayandplaysinline.MediaStreamremains opaque (packed planes or green‑screen). Native controls/PiP and recordings capture the raw stream—usegetTransparentBackgroundCanvas()when you need the transparent canvas.Written for commit c629603. Summary will update on new commits.