Skip to content

Commit

Permalink
Merge pull request #206 from THEOplayer/bugfix/ad_length
Browse files Browse the repository at this point in the history
Bugfix/ad length
  • Loading branch information
tvanlaerhoven authored Aug 7, 2024
2 parents 1f72d99 + 4a20290 commit d58cc51
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-stingrays-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@theoplayer/react-native-analytics-adobe-edge': minor
---

Fixed an issue where ad duration was reported as a floating-point value instead of an integer.
17 changes: 4 additions & 13 deletions adobe-edge/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
# Changelog
# @theoplayer/react-native-analytics-adobe-edge

## 0.1.1
## 0.1.0

### 🐛 Issues
### ✨ Features

- Fixed documentation on updating metadata through the connector.

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.1.0]

Initial release
- Initial release
10 changes: 5 additions & 5 deletions adobe-edge/src/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export function calculateAdvertisingPodDetails(adBreak: AdBreak, lastPodIndex: n
}
return {
index: podIndex ?? 0,
offset: adBreak.timeOffset,
offset: Math.trunc(currentAdBreakTimeOffset),
};
}

export function calculateAdvertisingDetails(ad: Ad, podPosition: number): AdobeAdvertisingDetails {
return {
podPosition,
length: ad.duration ?? 0,
name: 'TODO', // TODO
length: ad.duration ? Math.trunc(ad.duration) : 0,
name: 'NA', // TODO
playerName: 'THEOplayer',
};
}
Expand All @@ -53,8 +53,8 @@ export function calculateChapterDetails(cue: TextTrackCue): AdobeChapterDetails
const id = Number(cue.id);
const index = isNaN(id) ? 0 : id;
return {
length: (cue.endTime - cue.startTime) / 1000,
offset: cue.startTime / 1000,
length: Math.trunc((cue.endTime - cue.startTime) / 1000),
offset: Math.trunc(cue.startTime / 1000),
index,
};
}
Expand Down

0 comments on commit d58cc51

Please sign in to comment.