Skip to content

Commit

Permalink
revert: new joinTime calculation (#31) (#32)
Browse files Browse the repository at this point in the history
* flag is not needed as playback start is sent once for each media

* revert the joinTimeCalculattion
  • Loading branch information
odedhutzler authored Mar 5, 2019
1 parent 12a77fc commit 10dcfce
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/kava.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class Kava extends BasePlugin {
this.eventManager.listen(this._timer, KavaTimer.Event.RESET, () => this._resetSession());
this.eventManager.listen(this.player, this.player.Event.SOURCE_SELECTED, () => this._onSourceSelected());
this.eventManager.listen(this.player, this.player.Event.ERROR, event => this._onError(event));
this.eventManager.listen(this.player, this.player.Event.PLAYBACK_START, () => this._onPlaybackStart());
this.eventManager.listen(this.player, this.player.Event.FIRST_PLAY, () => this._onFirstPlay());
this.eventManager.listen(this.player, this.player.Event.TRACKS_CHANGED, () => this._setInitialTracks());
this.eventManager.listen(this.player, this.player.Event.PLAYING, () => this._onPlaying());
this.eventManager.listen(this.player, this.player.Event.FIRST_PLAYING, () => this._onFirstPlaying());
Expand Down Expand Up @@ -308,11 +308,9 @@ class Kava extends BasePlugin {
});
}

_onPlaybackStart(): void {
if (!this._firstPlayRequestTime) {
this._firstPlayRequestTime = Date.now();
this._sendAnalytics(KavaEventModel.PLAY_REQUEST);
}
_onFirstPlay(): void {
this._firstPlayRequestTime = Date.now();
this._sendAnalytics(KavaEventModel.PLAY_REQUEST);
}

_onSourceSelected(): void {
Expand Down

0 comments on commit 10dcfce

Please sign in to comment.