Skip to content

Commit

Permalink
Tweak player event tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Feb 2, 2016
1 parent fba563c commit 7fcdba0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export default class Player extends Component {
onPlayerPause = () => this.setState({ playing: false }); // TODO: Fix YT firing onPause when ending
onPlayerProgress = state => this.setState(this.state.seeking ? {} : state);
onPlayerDuration = duration => this.setState({ duration });
onPlayerEnded = () => this.props.onSkip();
onPlayerEnded = () => {
trackPlayerEvent('ended', this.props.activePost.url)
this.props.onSkip()
};
onPlayerError = () => this.props.onSkip();
onTogglePlaying = () => {
this.setState({ playing: !this.state.playing })
Expand All @@ -52,7 +55,6 @@ export default class Player extends Component {
onSeekEnd = fraction => {
this.setState({ seeking: false })
this.refs.player.seekTo(fraction)
trackPlayerEvent('seek', Math.round(fraction * 100))
};
render () {
const { activePost } = this.props
Expand Down

0 comments on commit 7fcdba0

Please sign in to comment.