-
Notifications
You must be signed in to change notification settings - Fork 143
Open
Description
Summary
When publishing from a mobile device (e.g. iPhone camera via <hang-publish>), the video orientation is incorrect on the watch side. The phone captures in landscape natively (e.g. 640x480) even when held in portrait, but no rotation metadata is included in the catalog, and the watch-side renderer doesn't apply rotation even if it were present.
Steps to Reproduce
- Open a
<hang-publish>page on an iPhone (using WebSocket fallback via@moq/web-transport-ws) - Select camera source, hold phone in portrait orientation
- Open the corresponding
<hang-watch>page in another browser - Video appears rotated 90 degrees — the viewer sees the image sideways
Observed Behavior
- Catalog contains
640x480coded dimensions with norotationfield - The watch-side canvas renderer (
watch/video/renderer.js) handlesflipbut notrotation - The publish side (
publish/video/index.d.ts) exposesflipas a Signal but has norotationSignal
Expected Behavior
- The publish side should detect device orientation (e.g. via
VideoFrame.rotation,window.screen.orientation, or MediaStreamTrack settings) and includerotationin the catalog - The watch-side renderer should read
catalog.rotationand apply the appropriate transform when drawing frames to canvas
Analysis
The catalog schema already supports rotation (it appears in the type definitions for both publish and watch catalog types). The gap is:
- Publish:
Video.Roothas aflip: Signal<boolean>but no correspondingrotationsignal, so rotation is never set in the catalog - Watch:
renderer.jslines 100-105 checkcatalog.flipand applyctx.scale(-1, 1)but have no corresponding rotation logic
Environment
@moq/hangv0.1.2@moq/web-transport-ws(WebSocket fallback)- Publishing from iPhone Safari (portrait), watching in Chrome desktop
- Relay:
cdn.moq.dev
Workaround
For now we're applying a CSS rotation on the watch side based on aspect ratio heuristics, but this is fragile and doesn't handle all cases correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels