use of com.google.ads.interactivemedia.v3.api.StreamDisplayContainer in project ExoPlayer by google.
the class ImaServerSideAdInsertionMediaSource method createStreamDisplayContainer.
private static StreamDisplayContainer createStreamDisplayContainer(ImaSdkFactory imaSdkFactory, ImaUtil.ServerSideAdInsertionConfiguration config, StreamPlayer streamPlayer) {
StreamDisplayContainer container = ImaSdkFactory.createStreamDisplayContainer(checkNotNull(config.adViewProvider.getAdViewGroup()), streamPlayer);
container.setCompanionSlots(config.companionAdSlots);
registerFriendlyObstructions(imaSdkFactory, container, config.adViewProvider);
return container;
}
use of com.google.ads.interactivemedia.v3.api.StreamDisplayContainer in project ExoPlayer by google.
the class ImaServerSideAdInsertionMediaSource method registerFriendlyObstructions.
private static void registerFriendlyObstructions(ImaSdkFactory imaSdkFactory, StreamDisplayContainer container, AdViewProvider adViewProvider) {
for (int i = 0; i < adViewProvider.getAdOverlayInfos().size(); i++) {
AdOverlayInfo overlayInfo = adViewProvider.getAdOverlayInfos().get(i);
container.registerFriendlyObstruction(imaSdkFactory.createFriendlyObstruction(overlayInfo.view, ImaUtil.getFriendlyObstructionPurpose(overlayInfo.purpose), overlayInfo.reasonDetail != null ? overlayInfo.reasonDetail : "Unknown reason"));
}
}
Aggregations