Skip to content

Commit

Permalink
- Update lastReportedAdPlayhead value in AdProgress event (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
GouravSna authored Feb 17, 2022
1 parent 280f880 commit 1a9f42f
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private void populateAdValues() {
log.d("lastReportedAdResource: " + lastReportedAdResource);
log.d("lastReportedAdDuration: " + lastReportedAdDuration);
log.d("lastReportedAdTitle: " + lastReportedAdTitle);
log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead);
printLastReportedAdPlayhead();
log.d("lastReportedAdBitrate: " + lastReportedAdBitrate);
}

Expand Down Expand Up @@ -244,7 +244,7 @@ private void addListeners() {
currentAdInfo = event.adInfo;
lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue();
lastReportedAdBitrate = currentAdInfo.getMediaBitrate();
log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead);
printLastReportedAdPlayhead();
fireStart();
fireJoin();
sendReportEvent(event.eventType());
Expand All @@ -259,7 +259,7 @@ private void addListeners() {
currentAdInfo = event.adInfo;
lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue();
lastReportedAdBitrate = currentAdInfo.getMediaBitrate();
log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead);
printLastReportedAdPlayhead();
firePause();
sendReportEvent(event.eventType());
});
Expand All @@ -272,7 +272,7 @@ private void addListeners() {
currentAdInfo = event.adInfo;
lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue();
lastReportedAdBitrate = currentAdInfo.getMediaBitrate();
log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead);
printLastReportedAdPlayhead();
fireResume();
sendReportEvent(event.eventType());
});
Expand All @@ -283,7 +283,7 @@ private void addListeners() {
return;
}
lastReportedAdPlayhead = lastReportedAdDuration;
log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead);
printLastReportedAdPlayhead();
fireStop();
sendReportEvent(event.eventType());
});
Expand Down Expand Up @@ -353,12 +353,13 @@ private void addListeners() {
});

messageBus.addListener(this, AdEvent.playHeadChanged, event -> {
lastReportedAdPlayhead = Long.valueOf(event.adPlayHead).doubleValue();
//We are not sending this event to youbora,
//so prevent it from dispatching through YouboraEvent.YouboraReport.
});

messageBus.addListener(this, AdEvent.adProgress, event -> {
lastReportedAdPlayhead = Long.valueOf(event.currentAdPosition / Consts.MILLISECONDS_MULTIPLIER).doubleValue();
printLastReportedAdPlayhead();
//We are not sending this event to youbora,
//so prevent it from dispatching through YouboraEvent.YouboraReport.
});
Expand Down

0 comments on commit 1a9f42f

Please sign in to comment.