Files
zyt/app/video_companion
2026-08-20 17:47:14 +08:00
..
2026-08-20 17:47:14 +08:00
2026-08-20 17:47:14 +08:00
2026-08-12 11:03:28 +08:00
2026-08-12 11:03:28 +08:00
2026-08-12 11:03:28 +08:00
2026-08-10 17:29:05 +08:00
2026-08-10 17:29:05 +08:00
2026-08-10 17:29:05 +08:00

Doctor Video Companion

这是桌面端专用的最小 Vue 3 / Vite 视频页面。它与 admin 的独立视频组件保持同一条 SDK 主链,直接使用固定版本 @trtc/calls-uikit-vue@4.4.6

构建

cd video_companion
npm ci
npm run build

构建产物位于 video_companion/dist/。Vite 使用相对资源路径,因此产物既能由 HTTPS 托管,也能由 QtWebEngine 从本地安装目录加载。

桌面端当前只在隔离的 QtWebEngine 中加载此页面。页面不会自行向后端领取通话票据,因此在后端提供服务端签发的一次性 handoff 前,系统浏览器模式与自动浏览器降级均被禁用。

宿主契约

页面加载后会暴露:

window.doctorCall.start({
  SDKAppID: 1400000000, // 也接受 sdkAppId
  userID: 'doctor_42',  // 也接受 userId
  userSig: '<后端短时票据>',
  targetUserId: 'patient_8', // 也接受 patientUserId
  diagnosisId: 123,
})

await window.doctorCall.hangup()

userSig 必须由业务后端签发。此页面不会生成 UserSig,也不接受或使用 SDKSecretKey。

状态、错误与挂断消息优先调用 window.qtVideoBridge.notify(JSON.stringify(message))。没有 Qt bridge 时,页面使用 postMessage 通知父窗口或 opener;都不可用时只输出不含票据的控制台状态。