-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vmap mid roll ad position reporting #83
Fix vmap mid roll ad position reporting #83
Conversation
f46e691
to
0a229a1
Compare
verify { videoAnalytics.reportAdBreakStarted(any(), any()) } | ||
player.listeners[PlayerEvent.AdStarted::class]?.forEach { it(TEST_AD_STARTED_EVENT) } | ||
verify { | ||
adAnalytics.reportAdStarted(match { it["c3.ad.position"] == AdPosition.PREROLL }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know this match
helper. Nice!
ad = object : Ad { | ||
override val clickThroughUrl: String? | ||
get() = "clickThroughUrl" | ||
override val data: AdData? | ||
get() = null | ||
override val height: Int | ||
get() = 100 | ||
override val id: String? | ||
get() = null | ||
override val isLinear: Boolean | ||
get() = true | ||
override val mediaFileUrl: String? | ||
get() = null | ||
override val width: Int | ||
get() = 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nit. Why implement this though getters rather than fields?
ad = object : Ad { | |
override val clickThroughUrl: String? | |
get() = "clickThroughUrl" | |
override val data: AdData? | |
get() = null | |
override val height: Int | |
get() = 100 | |
override val id: String? | |
get() = null | |
override val isLinear: Boolean | |
get() = true | |
override val mediaFileUrl: String? | |
get() = null | |
override val width: Int | |
get() = 200 | |
ad = object : Ad { | |
override val clickThroughUrl = "clickThroughUrl" | |
override val data = null | |
override val height = 100 | |
override val id = null | |
override val isLinear = true | |
override val mediaFileUrl = null | |
override val width = 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7ee0bd3 I went for a mock to make it easier to read.
|
||
// mid-roll ad break is scheduled at 15 seconds, will play immediately in case of the DASH | ||
// live stream due to absolute time stamps. | ||
player.expectEvent<PlayerEvent.AdBreakStarted> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't callAndExpectEvent
be used instead? The AdBreak start could be missed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in theory this could be cary. Unfortunately the test helpers seem to have an issue that cause a deadlock when loading in the callAndExpectEvent. 🙈 I'll keep it as-is. We should have a look at the test helpers at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Besides some style nits, nothing to add to the other review.
conviva/src/test/kotlin/com/bitmovin/analytics/conviva/ConvivaAnalyticsIntegrationTest.kt
Outdated
Show resolved
Hide resolved
conviva/src/test/kotlin/com/bitmovin/analytics/conviva/ConvivaAnalyticsIntegrationTest.kt
Outdated
Show resolved
Hide resolved
…AnalyticsIntegrationTest.kt Co-authored-by: Matthias Tamegger <[email protected]>
…AnalyticsIntegrationTest.kt Co-authored-by: Matthias Tamegger <[email protected]>
Problem
Ad position reporting for client side ad insertion with VMAP and Google IMA ads integration was reporting wrong ad position for mid- and post-roll ads.
Changes
As the timing information on the ad is not reported correctly for VMAP ads (tracked internally), we take the correct time from the current active ad break. This is in line with the tacking on web.