Skip to content

Commit

Permalink
Merge pull request #35 from THEOplayer/bugfix/custom-metadata-not-pas…
Browse files Browse the repository at this point in the history
…sed-on-replay

Bugfix/custom metadata not passed on replay
  • Loading branch information
jorisfluyt authored Jul 29, 2024
2 parents 4efa5dc + 1b3a11e commit 3e77cea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-carrots-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@theoplayer/conviva-connector-web": patch
---

Fixed an issue where the metadata is not passed correctly after a replay.
6 changes: 3 additions & 3 deletions conviva/src/integration/ConvivaHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class ConvivaHandler {
this.initializeSession();
}
this.customMetadata = { ...this.customMetadata, ...metadata };
this.convivaVideoAnalytics!.setContentInfo(metadata);
this.convivaVideoAnalytics!.setContentInfo(this.customMetadata);
}

setAdInfo(metadata: ConvivaMetadata): void {
Expand Down Expand Up @@ -333,6 +333,7 @@ export class ConvivaHandler {
private readonly onSourceChange = () => {
this.maybeReportPlaybackEnded();
this.currentSource = this.player.source;
this.customMetadata = {};
};

private readonly onEnded = () => {
Expand Down Expand Up @@ -371,13 +372,12 @@ export class ConvivaHandler {
this.convivaVideoAnalytics?.release();
this.convivaAdAnalytics = undefined;
this.convivaVideoAnalytics = undefined;

this.customMetadata = {};
}

destroy(): void {
this.maybeReportPlaybackEnded();
this.removeEventListeners();
this.customMetadata = {};
Analytics.release();
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3e77cea

Please sign in to comment.