1 | import { ComponentType } from 'react'
|
2 | import { CommonEventFunction, StandardProps } from './common'
|
3 |
|
4 | interface VoipRoomProps extends StandardProps {
|
5 | /** 进入房间用户的 openid
|
6 | * @default none
|
7 | * @supported weapp
|
8 | */
|
9 | openId?: string
|
10 |
|
11 | /** 对话窗口类型,自身传入 camera,其它用户传入 video
|
12 | * @default camera
|
13 | * @supported weapp
|
14 | */
|
15 | mode?: keyof VoipRoomProps.Mode
|
16 |
|
17 | /** 仅在 mode 为 camera 时有效,前置或后置,值为front, back
|
18 | * @default front
|
19 | * @supported weapp
|
20 | */
|
21 | devicePosition?: keyof VoipRoomProps.DevicePosition
|
22 |
|
23 | /** 创建对话窗口失败时触发
|
24 | * @supported weapp
|
25 | */
|
26 | onError?: CommonEventFunction
|
27 | }
|
28 |
|
29 | declare namespace VoipRoomProps {
|
30 | /** 对话窗口类型 */
|
31 | interface Mode {
|
32 | camera
|
33 | video
|
34 | }
|
35 |
|
36 | /** 摄像头类型 */
|
37 | interface DevicePosition {
|
38 | front
|
39 | back
|
40 | }
|
41 | }
|
42 |
|
43 | /** 多人音视频对话
|
44 | *
|
45 | * 需用户授权 `scope.camera`、`scope.record`。相关接口: [Taro.joinVoIPChat](/docs/apis/media/voip/joinVoIPChat)
|
46 | * 开通该组件权限后,开发者可在 joinVoIPChat 成功后,获取房间成员的 openid,传递给 voip-room 组件,以显示成员画面。
|
47 | * @classification media
|
48 | * @supported weapp
|
49 | * @example
|
50 | * ```tsx
|
51 | * export default class PageView extends Component {
|
52 | * constructor() {
|
53 | * super(...arguments)
|
54 | * }
|
55 | *
|
56 | * render() {
|
57 | * return (
|
58 | * <VoipRoom
|
59 | * openId="{{item}}"
|
60 | * mode="{{selfOpenId === item ? 'camera' : 'video'}}">
|
61 | * </VoipRoom>
|
62 | * )
|
63 | * }
|
64 | * }
|
65 | * ```
|
66 | * @see https://developers.weixin.qq.com/miniprogram/dev/component/voip-room.html
|
67 | */
|
68 | declare const VoipRoom: ComponentType<VoipRoomProps>
|
69 |
|
70 | export { VoipRoom, VoipRoomProps }
|