Skip to content

Commit

Permalink
refactor(types): sync components types
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Oct 11, 2023
1 parent 6a734e8 commit f4a8c34
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
13 changes: 11 additions & 2 deletions docs/components/media/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default class PageView extends Component {
| licenseUrl | `string` | || DRM 获取加密信息 url,仅 is-drm 为 true 时生效 |
| posterSize | `string` | || 当 poster 高宽比跟视频高宽不匹配时,如何显示 poster,设置规则同 background-size 一致。 |
| showThinProgressBar | `string` | || 当底部工具条隐藏时,是否显示细进度条(controls=false 时设置无效)。 |
| mobilenetHintType | `string` | || 移动网络提醒样式。<br /><br />0 - 不提醒<br />1 - tip 提醒<br />2 - 阻塞提醒(无消耗流量大小)<br />3 - 阻塞提醒(有消耗流量大小提醒) |
| mobilenetHintType | `number` | || 移动网络提醒样式。<br /><br />0 - 不提醒<br />1 - tip 提醒<br />2 - 阻塞提醒(无消耗流量大小)<br />3 - 阻塞提醒(有消耗流量大小提醒) |
| floatingMode | `string` | || 浮窗设置。暂时不支持全局浮窗。<br />可选值:<br /><br />none:无浮窗。<br />page:页面内浮窗。 |
| showNoWifiTip | `string` | || 非 wifi 环境下是否显示继续播放浮层 |
| showLockBtn | `string` | || 全屏模式下,是否显示锁屏按钮 |
Expand Down Expand Up @@ -242,7 +242,7 @@ export default class PageView extends Component {
| VideoProps.onPause | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
| VideoProps.onEnded | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
| VideoProps.onTimeUpdate | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
| VideoProps.onFullscreenChange | | | | | | | ✔️ | ✔️ | |
| VideoProps.onFullscreenChange | | | ✔️ | | | | ✔️ | ✔️ | |
| VideoProps.onWaiting | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | | |
| VideoProps.onError | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
| VideoProps.onProgress | ✔️ | | | ✔️ | ✔️ | | ✔️ | | |
Expand Down Expand Up @@ -311,6 +311,15 @@ playBtnPosition 的合法值
| --- | --- | --- |
| currentTime | `number` | 当前时间 |
| duration | `number` | 持续时间 |
| userPlayDuration | `number` | 用户实际观看时长 |
| videoDuration | `number` | 视频总时长 |

#### API 支持度

| API | 微信小程序 | 支付宝小程序 | H5 | React Native | Harmony |
| :---: | :---: | :---: | :---: | :---: | :---: |
| onTimeUpdateEventDetail.userPlayDuration | | ✔️ | | | |
| onTimeUpdateEventDetail.videoDuration | | ✔️ | | | |

### onFullscreenChangeEventDetail

Expand Down
12 changes: 10 additions & 2 deletions packages/taro-components/types/Video.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ interface VideoProps extends StandardProps {
*
* @supported alipay, jd
*/
mobilenetHintType?: string
mobilenetHintType?: number
/** 浮窗设置。暂时不支持全局浮窗。
* 可选值:
*
Expand Down Expand Up @@ -315,7 +315,7 @@ interface VideoProps extends StandardProps {
onTimeUpdate?: CommonEventFunction<VideoProps.onTimeUpdateEventDetail>
/** 当视频进入和退出全屏时触发
*
* @supported h5, rn
* @supported h5, rn, alipay
*/
onFullscreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
/** 视频出现缓冲时触发
Expand Down Expand Up @@ -488,6 +488,14 @@ declare namespace VideoProps {
currentTime: number
/** 持续时间 */
duration: number
/** 用户实际观看时长
* @supported alipay
*/
userPlayDuration: number
/** 视频总时长
* @supported alipay
*/
videoDuration: number
}
interface onFullscreenChangeEventDetail {
/** 方向 */
Expand Down

0 comments on commit f4a8c34

Please sign in to comment.