Skip to content

Conversation

@jorisfluyt
Copy link

@jorisfluyt jorisfluyt commented Jul 1, 2025

We currently pass duration as an integer. This PR improves this to use the Player API to get the duration as a double.
Remark : This player API will become available once 9.7 will be out!

// AssetName should never be an empty string
return mutableMapOf(
ConvivaSdkConstants.DURATION to if (ad is LinearAd) ad.duration else 0,
ConvivaSdkConstants.DURATION to if (ad is LinearAd) ad.durationAsDouble else 0.0,
Copy link
Contributor

@MattiasBuelens MattiasBuelens Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little bit more idiomatic perhaps:

Suggested change
ConvivaSdkConstants.DURATION to if (ad is LinearAd) ad.durationAsDouble else 0.0,
ConvivaSdkConstants.DURATION to (ad as? LinearAd)?.durationAsDouble ?? 0.0,

@MattiasBuelens
Copy link
Contributor

Hmm, should we postpone releasing the Android connectors for 9.7.0 until after we land this PR? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants