Search in sources :

Example 1 with StreamDisplayContainer

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;
}
Also used : StreamDisplayContainer(com.google.ads.interactivemedia.v3.api.StreamDisplayContainer)

Example 2 with StreamDisplayContainer

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"));
    }
}
Also used : AdOverlayInfo(com.google.android.exoplayer2.ui.AdOverlayInfo) CuePoint(com.google.ads.interactivemedia.v3.api.CuePoint)

Aggregations

CuePoint (com.google.ads.interactivemedia.v3.api.CuePoint)1 StreamDisplayContainer (com.google.ads.interactivemedia.v3.api.StreamDisplayContainer)1 AdOverlayInfo (com.google.android.exoplayer2.ui.AdOverlayInfo)1