Skip to content
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

Implement Uplynk ads api #29

Closed
wants to merge 5 commits into from
Closed

Implement Uplynk ads api #29

wants to merge 5 commits into from

Conversation

OlegRyz
Copy link
Contributor

@OlegRyz OlegRyz commented Aug 29, 2024

This PR implements the following properties:
adBreaks - when the addAdBreak and removeAdBreak events are triggered.
currentAdBreak - when the adBreakBeginEvent, AdBreakEndEvent or AdBreakSkipEvent are triggered.
currentAd - when the currentAdBreak gets updated as this property represents the ads of the currentAdBreak.

private set

private val eventDispatcher = UplynkEventDispatcher().also {
it.addListener(object : UplynkListener {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: make UplynkConnector implementing UplynkListener

Copy link
Contributor Author

@OlegRyz OlegRyz Aug 29, 2024

Choose a reason for hiding this comment

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

I thought about it, but didn't do it because UplynkConnector is a part of public API and I think it might be confusing for a user of this class. So I decided to do it like this.

Do you think it would be better to make UplynkConnector implementing UplynkListener?

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, it would be confusing..
Maybe we move the checks to the internal too?

Comment on lines +30 to +46
/**
* Scheduled ad breaks
*/
var adBreaks: List<UplynkAdBreak>? = null
private set

/**
* The ad break that is currently played or `null` otherwise
*/
var currentAdBreak: UplynkAdBreak? = null
private set

/**
* The ad that is currently played or `null` otherwise
*/
var currentAd: UplynkAd? = null
private set
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe more of a philosophical question: why do we have both UplynkConnector.currentAds and player.ads.currentAds? Wasn't the whole point of the custom SSAI integrations that we can put everything behind the THEOplayer ads API?

Same thing with the new UplynkListener methods: how are those different from the existing events on player.ads?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only difference between them is the type of Ads object. player.ads.currentAds - has common type of an ad, that is part of THEOplayer project. UplynkConnector.currentAds has specific type for Uplynk ads. The same as for UplynkListener

I think we have to discuss if we even need this PR or if we could find some other solution

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, I think this is a limitation of our custom SSAI API then. We should provide a way to add some integration-specific data to an custom Ad or AdBreak.

I suggest we park this PR for now until we have that new API.

@OlegRyz OlegRyz closed this Sep 4, 2024
@OlegRyz
Copy link
Contributor Author

OlegRyz commented Sep 4, 2024

This PR is not needed because of the new customData property in SSAI API

@MattiasBuelens MattiasBuelens added the 🔌 connector: uplynk Affects the Uplynk connector label Sep 4, 2024
@OlegRyz OlegRyz deleted the feature/uplynk-ads-api branch September 5, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌 connector: uplynk Affects the Uplynk connector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants