RTC channel lookups
The mini program SDK can look up channels, the user's own channel session and channel members over HTTP, and exports the channel type definitions. There's no LiveKit media integration for mini programs yet, so they can't join channels for audio and video.
ts
// im 已通过小程序 SDK 登录。
const channel = await im.channels.getChannel('meeting-demo');
const current = await im.channels.getCurrentSession();
// 成员查询需要本登录对应的有效频道会话,不能因可查频道就假设可查成员。
const participants = await im.channels.listParticipants('meeting-demo', { limit: 20 });
const canJoinMedia = im.channels.supported; // 当前为 false。- Lookups follow channel visibility and session permissions: restricted channels the user isn't allowed to see are treated as not existing.
- IDs are always strings. A
nullmedia state means unknown, not that the person is offline. joinrejects withunsupportedbefore taking any seat, even if the runtime happens to have a WebRTC global object with the same name. Don't bypass this check by calling your server's join API directly, or you'll take a seat with no media connection.- The mini program's built-in audio and video components can't stand in for a LiveKit integration. For now, use these lookups to show the channel state the user is allowed to see; for audio and video, use a platform with media support.
