@tarojs/components 3.6.2-canary.0 → 3.6.2-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/cjs/taro-input-core.cjs.entry.js +1 -1
  2. package/dist/cjs/taro-picker-core_2.cjs.entry.js +1 -1
  3. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +28 -18
  4. package/dist/cjs/taro-textarea-core.cjs.entry.js +2 -2
  5. package/dist/collection/components/input/input.js +1 -1
  6. package/dist/collection/components/picker/picker.js +1 -1
  7. package/dist/collection/components/swiper/swiper-item.js +16 -9
  8. package/dist/collection/components/swiper/swiper.js +12 -9
  9. package/dist/collection/components/textarea/textarea.js +7 -3
  10. package/dist/components/taro-input-core.js +1 -1
  11. package/dist/components/taro-picker-core.js +1 -1
  12. package/dist/components/taro-swiper-core.js +12 -9
  13. package/dist/components/taro-swiper-item-core.js +16 -9
  14. package/dist/components/taro-textarea-core.js +2 -2
  15. package/dist/esm/taro-input-core.entry.js +1 -1
  16. package/dist/esm/taro-picker-core_2.entry.js +1 -1
  17. package/dist/esm/taro-swiper-core_2.entry.js +28 -18
  18. package/dist/esm/taro-textarea-core.entry.js +2 -2
  19. package/dist/esm-es5/taro-input-core.entry.js +1 -1
  20. package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
  21. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  22. package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
  23. package/dist/taro-components/{p-4d390d17.entry.js → p-0b8b3af5.entry.js} +1 -1
  24. package/dist/taro-components/p-1c446c65.system.js +1 -1
  25. package/dist/taro-components/p-1eac7c75.system.entry.js +1 -0
  26. package/dist/taro-components/{p-3e23fa46.system.entry.js → p-39685396.system.entry.js} +1 -1
  27. package/dist/taro-components/{p-e53feb03.system.entry.js → p-58f9a827.system.entry.js} +1 -1
  28. package/dist/taro-components/{p-ab84c88e.entry.js → p-7704e165.entry.js} +1 -1
  29. package/dist/taro-components/{p-10046f1a.system.entry.js → p-a5afdc47.system.entry.js} +1 -1
  30. package/dist/taro-components/p-affb28de.entry.js +1 -0
  31. package/dist/taro-components/{p-7db63e92.entry.js → p-c30d1b2d.entry.js} +1 -1
  32. package/dist/taro-components/taro-components.esm.js +1 -1
  33. package/dist/types/components/textarea/textarea.d.ts +1 -1
  34. package/lib/react/components.js +81 -160
  35. package/lib/react/components.js.map +1 -1
  36. package/lib/vue2/components.d.ts +361 -589
  37. package/lib/vue2/components.js +249 -328
  38. package/lib/vue2/components.js.map +1 -1
  39. package/lib/vue3/components.js +81 -160
  40. package/lib/vue3/components.js.map +1 -1
  41. package/package.json +5 -5
  42. package/types/Ad.d.ts +2 -31
  43. package/types/AdCustom.d.ts +0 -4
  44. package/types/AnimationVideo.d.ts +0 -9
  45. package/types/AnimationView.d.ts +0 -6
  46. package/types/ArCamera.d.ts +0 -7
  47. package/types/Audio.d.ts +0 -18
  48. package/types/AwemeData.d.ts +0 -6
  49. package/types/Button.d.ts +3 -106
  50. package/types/Camera.d.ts +0 -28
  51. package/types/Canvas.d.ts +2 -17
  52. package/types/ChannelLive.d.ts +0 -2
  53. package/types/ChannelVideo.d.ts +0 -6
  54. package/types/Checkbox.d.ts +1 -8
  55. package/types/CheckboxGroup.d.ts +0 -2
  56. package/types/CommentDetail.d.ts +4 -10
  57. package/types/CommentList.d.ts +4 -20
  58. package/types/ContactButton.d.ts +0 -7
  59. package/types/CoverImage.d.ts +0 -11
  60. package/types/CoverView.d.ts +0 -26
  61. package/types/Editor.d.ts +0 -10
  62. package/types/FollowSwan.d.ts +0 -3
  63. package/types/Form.d.ts +1 -9
  64. package/types/FunctionalPageNavigator.d.ts +0 -11
  65. package/types/GridView.d.ts +5 -10
  66. package/types/Icon.d.ts +0 -14
  67. package/types/Image.d.ts +0 -31
  68. package/types/InlinePaymentPanel.d.ts +0 -9
  69. package/types/Input.d.ts +0 -62
  70. package/types/Label.d.ts +3 -2
  71. package/types/Lifestyle.d.ts +0 -3
  72. package/types/Like.d.ts +0 -17
  73. package/types/LivePlayer.d.ts +1 -58
  74. package/types/LivePusher.d.ts +0 -77
  75. package/types/Login.d.ts +0 -5
  76. package/types/Lottie.d.ts +0 -16
  77. package/types/Map.d.ts +19 -136
  78. package/types/MatchMedia.d.ts +0 -7
  79. package/types/MovableArea.d.ts +0 -1
  80. package/types/MovableView.d.ts +0 -35
  81. package/types/NavigationBar.d.ts +0 -6
  82. package/types/Navigator.d.ts +0 -27
  83. package/types/OfficialAccount.d.ts +0 -12
  84. package/types/OpenData.d.ts +0 -20
  85. package/types/PageContainer.d.ts +0 -21
  86. package/types/PageMeta.d.ts +0 -16
  87. package/types/Picker.d.ts +17 -45
  88. package/types/PickerView.d.ts +1 -12
  89. package/types/Progress.d.ts +0 -13
  90. package/types/Radio.d.ts +1 -8
  91. package/types/RadioGroup.d.ts +0 -2
  92. package/types/RichText.d.ts +1 -22
  93. package/types/RootPortal.d.ts +1 -2
  94. package/types/RtcRoom.d.ts +0 -16
  95. package/types/RtcRoomItem.d.ts +0 -3
  96. package/types/ScrollView.d.ts +2 -57
  97. package/types/ShareElement.d.ts +2 -7
  98. package/types/Slider.d.ts +0 -19
  99. package/types/Swiper.d.ts +0 -44
  100. package/types/SwiperItem.d.ts +0 -2
  101. package/types/Switch.d.ts +2 -11
  102. package/types/TabItem.d.ts +0 -4
  103. package/types/Tabs.d.ts +0 -8
  104. package/types/Text.d.ts +0 -7
  105. package/types/Textarea.d.ts +0 -36
  106. package/types/Video.d.ts +1 -112
  107. package/types/View.d.ts +0 -25
  108. package/types/VoipRoom.d.ts +0 -6
  109. package/types/WebView.d.ts +0 -6
  110. package/dist/taro-components/p-0aaf66d2.entry.js +0 -1
  111. package/dist/taro-components/p-da1f3d54.system.entry.js +0 -1
package/types/Input.d.ts CHANGED
@@ -5,163 +5,136 @@ interface InputProps extends StandardProps, FormItemProps {
5
5
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
6
6
  */
7
7
  value?: string
8
-
9
8
  /** input 的类型
10
9
  * @default "text"
11
10
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
12
11
  */
13
12
  type?: keyof InputProps.Type
14
-
15
13
  /** 是否是密码类型
16
14
  * @default false
17
15
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
18
16
  */
19
17
  password?: boolean
20
-
21
18
  /** 输入框为空时占位符
22
19
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
23
20
  */
24
21
  placeholder?: string
25
-
26
22
  /** 指定 placeholder 的样式
27
23
  * @supported weapp, alipay, swan, tt, qq, jd, rn
28
24
  */
29
25
  placeholderStyle?: string
30
-
31
26
  /** 指定 placeholder 的样式类
32
27
  * @default "input-placeholder"
33
28
  * @supported weapp, alipay, swan, tt, qq, jd
34
29
  */
35
30
  placeholderClass?: string
36
-
37
31
  /** 指定 placeholder 的文本颜色
38
32
  * @supported rn
39
33
  */
40
34
  placeholderTextColor?: string
41
-
42
35
  /** 是否禁用
43
36
  * @default false
44
37
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
45
38
  */
46
39
  disabled?: boolean
47
-
48
40
  /** 最大输入长度,设置为 -1 的时候不限制最大长度
49
41
  * @default 140
50
42
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
51
43
  */
52
44
  maxlength?: number
53
-
54
45
  /** 指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离
55
46
  * @default 0
56
47
  * @supported weapp, swan, tt, qq, jd
57
48
  */
58
49
  cursorSpacing?: number
59
-
60
50
  /** (即将废弃,请直接使用 focus )自动聚焦,拉起键盘
61
51
  * @default false
62
52
  * @deprecated
63
53
  * @supported weapp, qq, jd, h5
64
54
  */
65
55
  autoFocus?: boolean
66
-
67
56
  /** 获取焦点
68
57
  * @default false
69
58
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
70
59
  */
71
60
  focus?: boolean
72
-
73
61
  /** 设置键盘右下角按钮的文字,仅在type='text'时生效
74
62
  * @alipay confirm-type 与 enableNative 属性冲突,若希望 confirm-type 生效,enableNative 不能设定为 false,而且不能设定 always-system
75
63
  * @default done
76
64
  * @supported weapp, alipay, swan, tt, qq, jd, rn
77
65
  */
78
66
  confirmType?: keyof InputProps.ConfirmType
79
-
80
67
  /** 点击键盘右下角按钮时是否保持键盘不收起
81
68
  * @default false
82
69
  * @supported weapp, alipay, swan, tt, qq, jd
83
70
  */
84
71
  confirmHold?: boolean
85
-
86
72
  /** 指定focus时的光标位置
87
73
  * @supported weapp, alipay, swan, tt, qq, jd, rn
88
74
  */
89
75
  cursor?: number
90
-
91
76
  /** 光标起始位置,自动聚集时有效,需与selection-end搭配使用
92
77
  * @default -1
93
78
  * @supported weapp, alipay, swan, tt, qq, jd, rn
94
79
  */
95
80
  selectionStart?: number
96
-
97
81
  /** 光标结束位置,自动聚集时有效,需与selection-start搭配使用
98
82
  * @default -1
99
83
  * @supported weapp, alipay, swan, tt, qq, jd, rn
100
84
  */
101
85
  selectionEnd?: number
102
-
103
86
  /** 键盘弹起时,是否自动上推页面
104
87
  * @default true
105
88
  * @supported weapp, swan, tt, qq, jd
106
89
  */
107
90
  adjustPosition?: boolean
108
-
109
91
  /** focus 时,点击页面的时候不收起键盘
110
92
  * @default false
111
93
  * @supported weapp, tt
112
94
  */
113
95
  holdKeyboard?: boolean
114
-
115
96
  /**
116
97
  * 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效)
117
98
  * @default false
118
99
  * @supported weapp
119
100
  */
120
101
  alwaysEmbed?: boolean
121
-
122
102
  /**
123
103
  * 安全键盘加密公钥的路径,只支持包内路径
124
104
  * @supported weapp
125
105
  */
126
106
  safePasswordCertPath?: string
127
-
128
107
  /**
129
108
  * 安全键盘输入密码长度
130
109
  * @supported weapp
131
110
  */
132
111
  safePasswordLength?: number
133
-
134
112
  /**
135
113
  * 安全键盘加密时间戳
136
114
  * @supported weapp
137
115
  */
138
116
  safePasswordTimeStamp?: number
139
-
140
117
  /**
141
118
  * 安全键盘加密盐值
142
119
  * @supported weapp
143
120
  */
144
121
  safePasswordNonce?: string
145
-
146
122
  /**
147
123
  * 安全键盘计算hash盐值,若指定custom-hash 则无效
148
124
  * @supported weapp
149
125
  */
150
126
  safePasswordSalt?: string
151
-
152
127
  /**
153
128
  * 安全键盘计算hash的算法表达式,如 `md5(sha1('foo' + sha256(sm3(password + 'bar'))))`
154
129
  * @supported weapp
155
130
  */
156
131
  safePasswordCustomHash?: string
157
-
158
132
  /**
159
133
  * 当 type 为 number, digit, idcard 数字键盘是否随机排列
160
134
  * @default false
161
135
  * @supported alipay
162
136
  */
163
137
  randomNumber?: boolean
164
-
165
138
  /**
166
139
  * 是否为受控组件。为 true 时,value 内容会完全受 setData 控制。
167
140
  *
@@ -170,60 +143,44 @@ interface InputProps extends StandardProps, FormItemProps {
170
143
  * @supported alipay
171
144
  */
172
145
  controlled?: boolean
173
-
174
146
  /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
175
147
  * @supported h5
176
148
  */
177
149
  nativeProps?: Record<string, unknown>
178
-
179
150
  /** 组件名字,用于表单提交获取数据。
180
151
  * @supported alipay
181
152
  */
182
153
  name?: string
183
-
184
154
  /** 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效。
185
155
  * @default false
186
156
  * @supported alipay
187
157
  */
188
158
  alwaysSystem?: boolean
189
-
190
159
  /** 无障碍访问,(属性)元素的额外描述
191
160
  * @supported qq
192
161
  */
193
162
  ariaLabel?: string
194
-
195
- /** 是否启用原生键盘。
196
- * @supported alipay
197
- * @default true
198
- */
199
- enableNative?: boolean
200
-
201
163
  /** 当键盘输入时,触发input事件,event.detail = {value, cursor, keyCode},处理函数可以直接 return 一个字符串,将替换输入框的内容。
202
164
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
203
165
  */
204
166
  onInput?: CommonEventFunction<InputProps.inputEventDetail>
205
-
206
167
  /** 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度
207
168
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
208
169
  */
209
170
  onFocus?: CommonEventFunction<InputProps.inputForceEventDetail>
210
-
211
171
  /** 输入框失去焦点时触发
212
172
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
213
173
  */
214
174
  onBlur?: CommonEventFunction<InputProps.inputValueEventDetail>
215
-
216
175
  /** 点击完成按钮时触发
217
176
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
218
177
  * @h5 借用[Form 组件](./form)的`onSubmit`事件来替代
219
178
  */
220
179
  onConfirm?: CommonEventFunction<InputProps.inputValueEventDetail>
221
-
222
180
  /** 键盘高度发生变化的时候触发此事件
223
181
  * @supported weapp, qq
224
182
  */
225
183
  onKeyboardHeightChange?: CommonEventFunction<InputProps.onKeyboardHeightChangeEventDetail>
226
-
227
184
  /** 用户昵称审核完毕后触发,仅在 type 为 "nickname" 时有效,event.detail = { pass, timeout }
228
185
  * @supported weapp
229
186
  */
@@ -236,81 +193,64 @@ declare namespace InputProps {
236
193
  * @supported weapp, alipay, h5, rn
237
194
  */
238
195
  text
239
-
240
196
  /** 数字输入键盘
241
197
  * @supported weapp, alipay, h5, rn
242
198
  */
243
199
  number
244
-
245
200
  /** 身份证输入键盘
246
201
  *@supported weapp, alipay, rn
247
202
  */
248
203
  idcard
249
-
250
204
  /** 带小数点的数字键盘
251
205
  * @supported weapp, alipay, h5, rn
252
206
  */
253
207
  digit
254
-
255
208
  /** 密码安全输入键盘[指引](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/safe-password.html)
256
209
  * @supported weapp, alipay
257
210
  */
258
211
  'safe-password'
259
-
260
212
  /** 昵称输入键盘
261
213
  * @supported weapp, alipay
262
214
  */
263
215
  nickname
264
-
265
216
  /** 数字输入键盘
266
217
  * @supported alipay
267
218
  */
268
219
  numberpad
269
-
270
220
  /** 带小数点的数字键盘
271
221
  * @supported alipay
272
222
  */
273
223
  digitpad
274
-
275
224
  /** 身份证输入键盘
276
225
  * @supported alipay
277
226
  */
278
227
  idcardpad
279
228
  }
280
-
281
229
  /** Confirm 类型 */
282
230
  interface ConfirmType {
283
231
  /** 右下角按钮为“发送” */
284
232
  send
285
-
286
233
  /** 右下角按钮为“搜索” */
287
234
  search
288
-
289
235
  /** 右下角按钮为“下一个” */
290
236
  next
291
-
292
237
  /** 右下角按钮为“前往” */
293
238
  go
294
-
295
239
  /** 右下角按钮为“完成” */
296
240
  done
297
241
  }
298
-
299
242
  /** > 注意:React-Native 端 `inputEventDetail` 仅实现参数 `value`,若需实时获取光标位置则可通过 [`onSelectionChange`](https://reactnative.dev/docs/textinput#onselectionchange) 实现。 */
300
243
  interface inputEventDetail {
301
244
  /** 输入值 */
302
245
  value: string
303
-
304
246
  /** 光标位置 */
305
247
  cursor: number
306
-
307
248
  /** 键值 */
308
249
  keyCode: number
309
250
  }
310
251
  interface inputForceEventDetail {
311
252
  /** 输入值 */
312
253
  value: string
313
-
314
254
  /** 键盘高度 */
315
255
  height: number
316
256
  }
@@ -321,12 +261,10 @@ declare namespace InputProps {
321
261
  interface onKeyboardHeightChangeEventDetail {
322
262
  /** 键盘高度 */
323
263
  height: number
324
-
325
264
  /** 持续时间 */
326
265
  duration: number
327
266
  }
328
267
  }
329
-
330
268
  /** 输入框。该组件是原生组件,使用时请注意相关限制
331
269
  * @classification forms
332
270
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
package/types/Label.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { ComponentType } from 'react'
2
2
  import { StandardProps } from './common'
3
3
  interface LabelProps extends StandardProps {
4
- /** 绑定控件的 id */
4
+ /** 绑定控件的 id
5
+ * @supported weapp, alipay, swan, tt, qq, jd, h5
6
+ */
5
7
  for?: string
6
8
  }
7
-
8
9
  /** 用来改进表单组件的可用性。
9
10
  *
10
11
  * 使用for属性找到对应的id,或者将控件放在该标签下,当点击时,就会触发对应的控件。 for优先级高于内部控件,内部有多个控件的时候默认触发第一个控件。 目前可以绑定的控件有:button, checkbox, radio, switch。
@@ -5,18 +5,15 @@ interface LifestyleProps extends StandardProps {
5
5
  * @supported alipay
6
6
  */
7
7
  publicId?: string
8
-
9
8
  /** 文案。支持商家自定义,最多展示一行。
10
9
  * @supported alipay
11
10
  */
12
11
  memo?: string
13
-
14
12
  /** 当用户关注生活号成功后执行。
15
13
  * @supported alipay
16
14
  */
17
15
  onFollow?: CommonEventFunction
18
16
  }
19
-
20
17
  /** 关注生活号
21
18
  * @classification open
22
19
  * @supported alipay
package/types/Like.d.ts CHANGED
@@ -6,70 +6,58 @@ interface LikeProps extends StandardProps {
6
6
  * @default false
7
7
  */
8
8
  isLiked?: boolean
9
-
10
9
  /** 按钮模式。icon:表示仅有图标;mixture:表示图标文字结合
11
10
  * @supported swan
12
11
  * @default "icon"
13
12
  */
14
13
  mode?: string
15
-
16
14
  /** 图标类型。hand:表示手形;heart:表示心形
17
15
  * @supported swan
18
16
  * @default "hand"
19
17
  */
20
18
  iconType?: string
21
-
22
19
  /** 点赞按钮上的文案。默认为赞,仅在 mode 属性值为'mixture'时有效
23
20
  * @supported swan
24
21
  * @default "赞"
25
22
  */
26
23
  likeText?: string
27
-
28
24
  /** 点赞数量
29
25
  * @supported swan
30
26
  * @default 0
31
27
  */
32
28
  likeNum?: number
33
-
34
29
  /** 被点赞的对象类型。0:表示对文章内容进行点赞;1:表示对评论内容进行点赞
35
30
  * @supported swan
36
31
  * @default 0
37
32
  */
38
33
  likeType?: number
39
-
40
34
  /** 点赞动效形式。0:无动效;1:轻动效;2:强动效
41
35
  * @supported swan
42
36
  * @default 1
43
37
  */
44
38
  animationType?: number
45
-
46
39
  /** 点赞后是否弹出 toast 提示
47
40
  * @supported swan
48
41
  * @default false
49
42
  */
50
43
  isShowToast?: boolean
51
-
52
44
  /** toast 文案,默认为已点赞、已取消
53
45
  * @supported swan
54
46
  * @default ['已点赞', '已取消']
55
47
  */
56
48
  toastText?: string[]
57
-
58
49
  /** 点赞服务需要的必要参数
59
50
  * @supported swan
60
51
  */
61
52
  likeParam: LikeProps.ILikeParam
62
-
63
53
  /** 使用 npm 方式引入点赞组件时,点击按钮时在用户未登录状态下会触发此事件;使用动态库方式引入点赞组件时,点击按钮时在用户未登录状态下不会触发此事件
64
54
  * @supported swan
65
55
  */
66
56
  onError?: CommonEventFunction
67
-
68
57
  /** 点击点赞按钮,在点赞服务成功后将状态返回给使用组件者
69
58
  * @supported swan
70
59
  */
71
60
  onSuccess?: CommonEventFunction
72
-
73
61
  /** 点击点赞按钮,在点赞服务失败后将状态返回给使用组件者
74
62
  * @supported swan
75
63
  */
@@ -79,25 +67,20 @@ declare namespace LikeProps {
79
67
  interface ILikeParam {
80
68
  /** 用户身份唯一标识 */
81
69
  openid: string
82
-
83
70
  /** 被点赞的文章的 id,与 path 参数一一对应
84
71
  * @example "20200101"
85
72
  */
86
73
  snid: string
87
-
88
74
  /** 被点赞的评论 id */
89
75
  spid?: string
90
-
91
76
  /** 文章标题 */
92
77
  title: string
93
-
94
78
  /** 智能小程序内页链接,最长不能超过 194 字符
95
79
  * @example "/pages/index/index"
96
80
  */
97
81
  path: string
98
82
  }
99
83
  }
100
-
101
84
  /** 点赞
102
85
  * @classification open
103
86
  * @supported swan
@@ -5,139 +5,114 @@ interface LivePlayerProps extends StandardProps {
5
5
  * @supported weapp, swan, tt, qq, jd
6
6
  */
7
7
  src?: string
8
-
9
8
  /** 模式
10
9
  * @default "live"
11
10
  * @supported weapp, qq, jd
12
11
  */
13
12
  mode?: keyof LivePlayerProps.Mode
14
-
15
13
  /** 自动播放
16
14
  * @default false
17
15
  * @supported weapp, swan, tt, qq, jd
18
16
  */
19
17
  autoplay?: boolean
20
-
21
18
  /** 是否静音
22
19
  * @default false
23
20
  * @supported weapp, swan, tt, qq, jd
24
21
  */
25
22
  muted?: boolean
26
-
27
23
  /** 画面方向
28
24
  * @default "vertical"
29
25
  * @supported weapp, swan, tt, qq, jd
30
26
  */
31
27
  orientation?: keyof LivePlayerProps.Orientation
32
-
33
28
  /** 填充模式
34
29
  * @default "contain"
35
30
  * @supported weapp, swan, tt, qq, jd
36
31
  */
37
32
  objectFit?: keyof LivePlayerProps.objectFit
38
-
39
33
  /** 进入后台时是否静音(已废弃,默认退台静音)
40
34
  * @default false
41
35
  * @supported weapp, swan
42
36
  * @deprecated
43
37
  */
44
38
  backgroundMute?: boolean
45
-
46
39
  /** 最小缓冲区,单位s
47
40
  * @default 1
48
41
  * @supported weapp, swan, qq
49
42
  */
50
43
  minCache?: number
51
-
52
44
  /** 最大缓冲区,单位s
53
45
  * @default 3
54
46
  * @supported weapp, swan, qq
55
47
  */
56
48
  maxCache?: number
57
-
58
49
  /** 声音输出方式
59
50
  * @default "speaker"
60
51
  * @supported weapp, qq, jd
61
52
  */
62
53
  soundMode?: keyof LivePlayerProps.soundMode
63
-
64
54
  /** 当跳转到本小程序的其他页面时,是否自动暂停本页面的实时音视频播放
65
55
  * @default true
66
56
  * @supported weapp, qq
67
57
  */
68
58
  autoPauseIfNavigate?: boolean
69
-
70
59
  /** 设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: ["push", "pop"])
71
60
  * @supported weapp
72
61
  */
73
62
  pictureInPictureMode?: ('push' | 'pop')[] | 'push' | 'pop' | ''
74
-
75
63
  /** 当跳转到其它微信原生页面时,是否自动暂停本页面的实时音视频播放
76
64
  * @supported weapp, qq
77
65
  */
78
66
  autoPauseIfOpenNative?: string
79
-
80
67
  /** 格式固定为 https://servicewechat.com/{appid}/{version}/page-frame.html,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本;
81
68
  * @supported weapp
82
69
  */
83
70
  referrerPolicy?: 'origin' | 'no-referrer'
84
-
85
71
  /** 设置署名水印
86
72
  * @supported tt
87
73
  */
88
74
  signature?: string
89
-
90
75
  /** 是否回调metadata
91
76
  * @supported qq
92
77
  */
93
78
  enableMetadata?: string
94
-
95
79
  /** live-player 属性的唯一标志符
96
80
  * @supported swan
97
81
  */
98
82
  id?: string
99
-
100
83
  /** 是否开启手机横屏时自动全屏,当系统设置开启自动旋转时生效
101
84
  * @supported weapp
102
85
  * @default false
103
86
  */
104
- enableAutoRotation?: string
105
-
87
+ enableAutoRotation?: boolean
106
88
  /** 播放状态变化事件,detail = {code}
107
89
  * @supported weapp, swan, tt, qq, jd
108
90
  */
109
91
  onStateChange?: CommonEventFunction<LivePlayerProps.onStateChangeEventDetail>
110
-
111
92
  /** 全屏变化事件,detail = {direction, fullScreen}
112
93
  * @supported weapp, swan, tt, qq, jd
113
94
  */
114
95
  onFullScreenChange?: CommonEventFunction<LivePlayerProps.onFullScreenChangeEventDetail>
115
-
116
96
  /** 网络状态通知,detail = {info}
117
97
  * @supported weapp, swan, qq
118
98
  */
119
99
  onNetStatus?: CommonEventFunction<LivePlayerProps.onNetStatusEventDetail>
120
-
121
100
  /** 播放音量大小通知,detail = {}
122
101
  * @supported weapp
123
102
  */
124
103
  onAudioVolumeNotify?: CommonEventFunction<{}>
125
-
126
104
  /** 播放器进入小窗
127
105
  * @supported weapp
128
106
  */
129
107
  onEnterPictureInPicture?: CommonEventFunction
130
-
131
108
  /** 播放器退出小窗
132
109
  * @supported weapp
133
110
  */
134
111
  onLeavePictureInPicture?: CommonEventFunction
135
-
136
112
  /** 播放错误事件
137
113
  * @supported tt
138
114
  */
139
115
  onError?: CommonEventFunction
140
-
141
116
  /** metadata通知,detail = {info}
142
117
  * @supported qq
143
118
  */
@@ -148,34 +123,27 @@ declare namespace LivePlayerProps {
148
123
  interface Mode {
149
124
  /** 直播 */
150
125
  live
151
-
152
126
  /** 实时通话,该模式时延更低 */
153
127
  RTC
154
128
  }
155
-
156
129
  /** orientation 的合法值 */
157
130
  interface Orientation {
158
131
  /** 竖直 */
159
132
  vertical
160
-
161
133
  /** 水平 */
162
134
  horizontal
163
135
  }
164
-
165
136
  /** objectFit 的合法值 */
166
137
  interface objectFit {
167
138
  /** 图像长边填满屏幕,短边区域会被填充⿊⾊ */
168
139
  contain
169
-
170
140
  /** 图像铺满屏幕,超出显示区域的部分将被截掉 */
171
141
  fillCrop
172
142
  }
173
-
174
143
  /** soundMode 的合法值 */
175
144
  interface soundMode {
176
145
  /** 扬声器 */
177
146
  speaker
178
-
179
147
  /** 听筒 */
180
148
  ear
181
149
  }
@@ -186,87 +154,62 @@ declare namespace LivePlayerProps {
186
154
  interface onFullScreenChangeEventDetail {
187
155
  /** 方向 */
188
156
  direction: number
189
-
190
157
  /** 全屏 */
191
158
  fullScreen: number | boolean
192
159
  }
193
160
  interface onNetStatusEventDetail {
194
161
  info: NetStatus
195
162
  }
196
-
197
163
  /** 状态码 */
198
164
  interface Status {
199
165
  /** 已经连接服务器 */
200
166
  2001
201
-
202
167
  /** 已经连接 RTMP 服务器,开始拉流 */
203
168
  2002
204
-
205
169
  /** 网络接收到首个视频数据包(IDR) */
206
170
  2003
207
-
208
171
  /** 视频播放开始 */
209
172
  2004
210
-
211
173
  /** 视频播放进度 */
212
174
  2005
213
-
214
175
  /** 视频播放结束 */
215
176
  2006
216
-
217
177
  /** 视频播放Loading */
218
178
  2007
219
-
220
179
  /** 解码器启动 */
221
180
  2008
222
-
223
181
  /** 视频分辨率改变 */
224
182
  2009
225
-
226
183
  /** 网络断连,且经多次重连抢救无效,更多重试请自行重启播放 */
227
184
  '-2301'
228
-
229
185
  /** 获取加速拉流地址失败 */
230
186
  '-2302'
231
-
232
187
  /** 当前视频帧解码失败 */
233
188
  2101
234
-
235
189
  /** 当前音频帧解码失败 */
236
190
  2102
237
-
238
191
  /** 网络断连, 已启动自动重连 */
239
192
  2103
240
-
241
193
  /** 网络来包不稳:可能是下行带宽不足,或由于主播端出流不均匀 */
242
194
  2104
243
-
244
195
  /** 当前视频播放出现卡顿 */
245
196
  2105
246
-
247
197
  /** 硬解启动失败,采用软解 */
248
198
  2106
249
-
250
199
  /** 当前视频帧不连续,可能丢帧 */
251
200
  2107
252
-
253
201
  /** 当前流硬解第一个I帧失败,SDK自动切软解 */
254
202
  2108
255
-
256
203
  /** RTMP -DNS解析失败 */
257
204
  3001
258
-
259
205
  /** RTMP服务器连接失败 */
260
206
  3002
261
-
262
207
  /** RTMP服务器握手失败 */
263
208
  3003
264
-
265
209
  /** RTMP 读/写失败 */
266
210
  3005
267
211
  }
268
212
  }
269
-
270
213
  /** 实时音视频播放。相关api:Taro.createLivePlayerContext
271
214
  *
272
215
  * 需要先通过类目审核,再在小程序管理后台,“设置”-“接口设置”中自助开通该组件权限。