Skip to content

EnvironmentCheckResult

Properties

checks

checks: object

Per-item check results (for diagnostics or fine-grained UI hints).

browser

browser: boolean

是否为浏览器环境(存在 window/document)。Browser environment available.

mediaDevices

mediaDevices: boolean

navigator.mediaDevices.getUserMedia 是否可用。mediaDevices API available.

secureContext

secureContext: boolean

是否为安全上下文(HTTPS 或 localhost),getUserMedia 必需。Secure context (HTTPS / localhost).

webrtc

webrtc: boolean

TRTC.isSupported()(或自定义适配器)判定 WebRTC 是否可用。WebRTC supported by adapter.


detail?

optional detail?: unknown

底层适配器返回的原始排障信息(如 TRTC.isSupported 的 detail)。Raw adapter detail.


isSupported

isSupported: boolean

综合判断:当前环境是否满足课堂正常运行的最低要求。 Aggregate verdict — true 表示所有关键检测项均通过;false 表示存在阻塞项(见 reasons / checks)。


reasons?

optional reasons?: ("NotBrowser" | "InsecureContext" | "NoMediaDevices" | "WebRTCUnsupported")[]

Reasons for failure (only present when isSupported=false). Possible values: Node) / Not running in a browser (SSR / Node) Not a secure context (HTTPS / localhost required)

  • 'NoMediaDevices' 缺少 navigator.mediaDevices.getUserMedia / mediaDevices API unavailable Underlying WebRTC unsupported