Skip to content

Commit

Permalink
fix(FEC-7164): mobile seekbar on tap event handler (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dvir Hazout authored and Dan Ziv committed Oct 2, 2017
1 parent 635e511 commit cc66178
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/seekbar/seekbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ class SeekBarControl extends Component {
}
}

/**
* onTap event handler
*
* @param {Event} e - onClick event
* @returns {void}
* @memberof SeekBarControl
*/
onTap(e: Event): void {
if (!this.props.isMobile) return;

let time = this.getTime(e);
this.props.changeCurrentTime(time);
this.updateSeekBarProgress(time, this.props.duration);
this.props.updateSeekbarDraggingStatus(false);
}

/**
* player mouse up handler for seekbar porpuses
*
Expand Down Expand Up @@ -355,6 +371,7 @@ class SeekBarControl extends Component {
aria-valuemax={Math.round(this.props.duration)}
aria-valuenow={Math.round(this.props.currentTime)}
aria-valuetext={`${toHHMMSS(this.props.currentTime)} of ${toHHMMSS(this.props.duration)}`}
onClick={e => this.onTap(e)}
onMouseMove={e => this.onSeekbarMouseMove(e)}
onMouseDown={e => this.onSeekbarMouseDown(e)}
onTouchStart={e => this.onSeekbarTouchStart(e)}
Expand Down

0 comments on commit cc66178

Please sign in to comment.