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

How exoplayer works with other advertising SDKs? #4769

Closed
Romantic-LiXuefeng opened this issue Sep 4, 2018 · 3 comments
Closed

How exoplayer works with other advertising SDKs? #4769

Romantic-LiXuefeng opened this issue Sep 4, 2018 · 3 comments
Assignees

Comments

@Romantic-LiXuefeng
Copy link

Since the IMA sdk code cannot be viewed completely,I can't understand how exoplayer interacts with IMA sdk? Please give me some advices how to custom a AdLoader to support pre_roll, mid_roll,post_roll? thanks!
Our own ad sdk just send a request to server, then server response with informations of ads. The information contains ad uri, duration, timeoffset(when to play ad), ad type(pre/mid/post) and so on.

@tonihei
Copy link
Collaborator

tonihei commented Sep 4, 2018

The code with which ExoPlayer interacts with the IMA SDK can be viewed here. If you have another SDK, please implement a matching AdsLoader.

In its simplest implementation, the AdsLoader should request the ads in attachPlayer and abandon all requests in detachPlayer. As soon as you have the information about the ads, create a AdPlaybackState and call onAdPlaybackState in the provided listener to inform the player of the ad information. Similarly, you should call onAdLoadError if you fail to load the ad.
You will also need to add a listener to the player and listen to onPositionDiscontinuity to know when an ad has been played and to update the AdPlaybackState accordingly. This prevents that the same ad is played again.

@tonihei tonihei self-assigned this Sep 4, 2018
@Romantic-LiXuefeng
Copy link
Author

Romantic-LiXuefeng commented Sep 5, 2018

I found issue #4680, @andrewlewis said that will give a implementing like a FixedAdsLoader . I have tried with your advices. It's not easy. Hope you can give a sample code. @tonihei

@tonihei
Copy link
Collaborator

tonihei commented Sep 5, 2018

Yes, #4680 is pretty similar. If you have all the ad information in advance before starting to play the video, such a FixedAdsLoader would help as well. Unfortunately, we don't have an example yet and #4680 is used to track that.

Closing this issue as duplicate. If you think your issue is different, please feel free to reopen.

@tonihei tonihei closed this as completed Sep 5, 2018
@google google locked and limited conversation to collaborators Jan 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants