Skip to content

Commit

Permalink
fix(FEC-8305): In Live videos there are progress events sent (11-14) (#9
Browse files Browse the repository at this point in the history
)

Do not sent progress reports on live entries.
  • Loading branch information
Dan Ziv authored Jun 13, 2018
1 parent e6c0e0b commit 3f38242
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/kava.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,22 +271,24 @@ export default class Kava extends BasePlugin {

_onTimeUpdate(): void {
this._updatePlayTimeSumModel();
const percent = this.player.currentTime / this.player.duration;
if (!this._timePercentEvent.PLAY_REACHED_25 && percent >= 0.25) {
this._timePercentEvent.PLAY_REACHED_25 = true;
this._sendAnalytics(KavaEventModel.PLAY_REACHED_25_PERCENT);
}
if (!this._timePercentEvent.PLAY_REACHED_50 && percent >= 0.5) {
this._timePercentEvent.PLAY_REACHED_50 = true;
this._sendAnalytics(KavaEventModel.PLAY_REACHED_50_PERCENT);
}
if (!this._timePercentEvent.PLAY_REACHED_75 && percent >= 0.75) {
this._timePercentEvent.PLAY_REACHED_75 = true;
this._sendAnalytics(KavaEventModel.PLAY_REACHED_75_PERCENT);
}
if (!this._timePercentEvent.PLAY_REACHED_100 && percent === 1) {
this._timePercentEvent.PLAY_REACHED_100 = true;
this._sendAnalytics(KavaEventModel.PLAY_REACHED_100_PERCENT);
if (!this.player.isLive()) {
const percent = this.player.currentTime / this.player.duration;
if (!this._timePercentEvent.PLAY_REACHED_25 && percent >= 0.25) {
this._timePercentEvent.PLAY_REACHED_25 = true;
this._sendAnalytics(KavaEventModel.PLAY_REACHED_25_PERCENT);
}
if (!this._timePercentEvent.PLAY_REACHED_50 && percent >= 0.5) {
this._timePercentEvent.PLAY_REACHED_50 = true;
this._sendAnalytics(KavaEventModel.PLAY_REACHED_50_PERCENT);
}
if (!this._timePercentEvent.PLAY_REACHED_75 && percent >= 0.75) {
this._timePercentEvent.PLAY_REACHED_75 = true;
this._sendAnalytics(KavaEventModel.PLAY_REACHED_75_PERCENT);
}
if (!this._timePercentEvent.PLAY_REACHED_100 && percent === 1) {
this._timePercentEvent.PLAY_REACHED_100 = true;
this._sendAnalytics(KavaEventModel.PLAY_REACHED_100_PERCENT);
}
}
}

Expand Down

0 comments on commit 3f38242

Please sign in to comment.