Skip to content

Commit

Permalink
fix(h5): 修复h5 Video组件在为获取到视频时长时(time可能为null或者undefined)显示NaN:NaN问题 (#…
Browse files Browse the repository at this point in the history
…9516)

Co-authored-by: liujie <[email protected]>
Co-authored-by: Li,Weitao <[email protected]>
  • Loading branch information
3 people authored Jun 16, 2021
1 parent e303ce5 commit aad5238
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-components/src/components/video/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const formatTime = time => {
if (time === null) return ''
if (time == null) return ''
const sec = Math.round(time % 60)
const min = Math.round((time - sec) / 60)
return `${min < 10 ? `0${min}` : min}:${sec < 10 ? `0${sec}` : sec}`
Expand Down

0 comments on commit aad5238

Please sign in to comment.