Skip to content

Commit 6f95806

Browse files
committed
fix: Drop bitrate attributes before content/ad start
contentBitrate, contentRenditionBitrate, adBitrate, and adRenditionBitrate are now only included in events after the first frame is shown (CONTENT_START/AD_START). This ensures bitrate values represent actual playback quality rather than pre-start estimates, aligning behavior with the JavaScript video-core-js library.
1 parent 8dcadd0 commit 6f95806

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## ## [4.0.6](https://github.com/newrelic/video-agent-android/compare/v4.0.5...v4.0.6) (2026-01-30)
2+
3+
### Bug Fixes
4+
5+
* Drop bitrate attributes before content/ad start - `contentBitrate`, `contentRenditionBitrate`, `adBitrate`, and `adRenditionBitrate` are now only included in events after the first frame is shown (CONTENT_START/AD_START). This ensures bitrate values represent actual playback quality rather than pre-start estimates, aligning behavior with the JavaScript video-core-js library.
6+
17
## [4.0.5](https://github.com/newrelic/video-agent-android/compare/v4.0.4...v4.0.5) (2026-01-20)
28

39
### Bug Fixes

NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,11 @@ public Map<String, Object> getAttributes(String action, Map<String, Object> attr
163163

164164
if (state.isAd) {
165165
attr.put("adTitle", getTitle());
166-
attr.put("adBitrate", getBitrate());
167-
attr.put("adRenditionBitrate", getRenditionBitrate());
166+
// Only add bitrate attributes after ad has started (first frame shown)
167+
if (state.isStarted) {
168+
attr.put("adBitrate", getBitrate());
169+
attr.put("adRenditionBitrate", getRenditionBitrate());
170+
}
168171
attr.put("adRenditionWidth", getRenditionWidth());
169172
attr.put("adRenditionHeight", getRenditionHeight());
170173
attr.put("adDuration", getDuration());
@@ -199,9 +202,11 @@ public Map<String, Object> getAttributes(String action, Map<String, Object> attr
199202
}
200203

201204
attr.put("contentTitle", getTitle());
202-
// attr.put("contentBitrate", getBitrate());
203-
attr.put("contentBitrate", getActualBitrate());
204-
attr.put("contentRenditionBitrate", getRenditionBitrate());
205+
// Only add bitrate attributes after content has started (first frame shown)
206+
if (state.isStarted) {
207+
attr.put("contentBitrate", getActualBitrate());
208+
attr.put("contentRenditionBitrate", getRenditionBitrate());
209+
}
205210
attr.put("contentRenditionWidth", getRenditionWidth());
206211
attr.put("contentRenditionHeight", getRenditionHeight());
207212
attr.put("contentDuration", getDuration());

local.properties

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
## This file is automatically generated by Android Studio.
2-
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3-
#
4-
# This file should *NOT* be checked into Version Control Systems,
1+
## This file must *NOT* be checked into Version Control Systems,
52
# as it contains information specific to your local configuration.
63
#
74
# Location of the SDK. This is only used by Gradle.
85
# For customization when using a Version Control System, please read the
96
# header note.
10-
sdk.dir=/Users/asantaren/Library/Android/sdk
7+
#Thu Jan 29 23:59:07 IST 2026
8+
sdk.dir=/Users/bsaraswat/Library/Android/sdk

0 commit comments

Comments
 (0)