Skip to content

Commit

Permalink
feat(components):使组件接受 duration 属性 (#4138)
Browse files Browse the repository at this point in the history
  • Loading branch information
A0150315 authored and luckyadam committed Aug 12, 2019
1 parent ec02f49 commit 4a9f79d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/taro-components/src/components/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ class Video extends Component {
danmuBtn
} = this.props
const { enableDanmu, isFirst, isMute, isFullScreen } = this.state
const duration = formatTime(this.state.duration)
const duration = formatTime(this.props.duration || this.state.duration || null)

const videoProps = {
id,
Expand Down Expand Up @@ -478,7 +478,7 @@ class Video extends Component {
onTouchStart={this.onTouchStartContainer}
onClick={this.onClickContainer}>
<video {...videoProps}>暂时不支持播放该视频</video>
<Controls controls={controls} currentTime={this.currentTime} duration={this.state.duration} isPlaying={this.state.isPlaying} pauseFunc={this.pause} playFunc={this.play} seekFunc={this.seek} showPlayBtn={showPlayBtn} showProgress={showProgress} ref={this.getControlsRef}>
<Controls controls={controls} currentTime={this.currentTime} duration={this.props.duration || this.state.duration || null} isPlaying={this.state.isPlaying} pauseFunc={this.pause} playFunc={this.play} seekFunc={this.seek} showPlayBtn={showPlayBtn} showProgress={showProgress} ref={this.getControlsRef}>
{showMuteBtn && (
<div
className={classnames('taro-video-mute', {
Expand Down

0 comments on commit 4a9f79d

Please sign in to comment.