EnvironmentCheckResult
Properties
checks
checks:
object
各分项检测结果(用于排障 / UI 细化提示)。
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?
optionaldetail?:unknown
底层适配器返回的原始排障信息(如 TRTC.isSupported 的 detail)。Raw adapter detail.
isSupported
isSupported:
boolean
综合判断:当前环境是否满足课堂正常运行的最低要求。 Aggregate verdict — true 表示所有关键检测项均通过;false 表示存在阻塞项(见 reasons / checks)。
reasons?
optionalreasons?: ("NotBrowser"|"InsecureContext"|"NoMediaDevices"|"WebRTCUnsupported")[]
不支持的原因列表(仅当 isSupported=false 时存在),每条为枚举字符串,便于业务做精确分支:
- 'NotBrowser' 非浏览器环境(如 SSR
- 'InsecureContext' 非安全上下文(需 HTTPS 或 localhost)
- 'NoMediaDevices' 缺少 navigator.mediaDevices.getUserMedia / mediaDevices API unavailable
- 'WebRTCUnsupported' TRTC.isSupported() 判定不支持