Released: 2026-04-02 Updated: 2026-03-31
Summary: New diagnostic tools for screen sharing and camera troubleshooting, including APIs to detect environment issues, permission errors, and black screens, with real-time progress updates and privacy safeguards. New error codes, expanded test coverage, refactored user-agent detection using ua-parser-js, cleaned up documentation, and fixed inconsistent bandwidth units.
Added
- Support for screen-sharing diagnostics to check whether the device, system, or browser supports screen sharing.
- New API Prober.diagnoseScreenShare(options, progressListener) — a 3-phase diagnostic to detect why screen sharing fails on user devices:
- Phase 1 (Static Checks): Validates environment prerequisites — mobile device detection, HTTPS secure context, browser version (Chrome/Edge/Firefox/Opera/Safari≥17), getDisplayMedia API availability, OffscreenCanvas, and Permissions API.
- Phase 2 (Permission Capture): Attempts getDisplayMedia() and classifies errors into system-denied (ERR_CODE -12), user-cancelled (ERR_CODE -13), or no display source found.
- Phase 3 (Frame Analysis): Samples video frames via MediaStreamTrackProcessor, computes BT.601 average luminance, and detects all-black screen capture (ERR_CODE -14 if >80% frames are black).
- Progress listener callback provides real-time phase/state/message updates for UI integration.
- Privacy guarantee: only scalar luminance values are extracted; VideoFrame.close() is called immediately; no pixel data stored or transmitted.
- 4 new error codes: SCREEN_SHARE_STATIC_CHECK_FAILED (-11), SCREEN_SHARE_PERMISSION_DENIED (-12), SCREEN_SHARE_USER_CANCELLED (-13), SCREEN_SHARE_BLACK_SCREEN (-14).
- 3 new CheckItem entries in Reporter.reportFeatures(): Secure Context (HTTPS), Permissions API, displaySurface constraint support.
- New API Prober.diagnoseScreenShare(options, progressListener) — a 3-phase diagnostic to detect why screen sharing fails on user devices:
- Camera dump
- New API Prober.startCameraDump(options) — records camera stream with per-frame luminance analysis for offline troubleshooting of camera preview issues (e.g., black frames, flicker).
- Outputs a downloadable .probe.tar[.gz] bundle containing: video.webm, frames.jsonl (per-frame luminance stats), events.jsonl (lifecycle events), and meta.json.
- Progress callback reports real-time state, elapsed time, frame count, black frame count/ratio.
- Chrome-only (requires MediaStreamTrackProcessor).
- 2 new error codes: FAILED_TO_DUMP_CAMERA (-9), FAILED_TO_BUILD_BUNDLE (-10).
- New tests
- 33 new tests added for screen share diagnostic (all passing under node:test).
- Test coverage includes: static checks (desktop/mobile/insecure), permission error classification, luminance computation, engineering dump, full diagnostic flow, and Reporter integration.
Changed
- UA detection refactor
- Replaced ~100 lines of hand-rolled UA/OS/browser detection regex in screen_share_helper.js with ua-parser-js (UAParser), which is already a project dependency.
- Consistent detection results across the SDK by reusing the same UA parsing library.
- Documentation cleanup
- Added @ignore JSDoc tags to internal helper functions (screen_share_helper, screen_share_diagnostic, camera_dump, tar, utils) so only Prober and Reporter public APIs appear in generated doc.md and HTML docs.
Fixed
- Issue where network bandwidth units were inconsistent.