首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Brightcove iOS SDK中的广告

Brightcove iOS SDK中的广告
EN

Stack Overflow用户
提问于 2012-10-25 04:05:23
回答 1查看 715关注 0票数 2

有人知道如何在新的Brightcove iOS SDK中的BCPlayerView / BCVideo / BCPlayerItem中实现对广告的调用吗?我可以在哪里指定广告服务器?这需要在Brightcove Studio中完成吗?

EN

回答 1

Stack Overflow用户

发布于 2012-10-26 02:23:33

Brightcove iOS player目前还没有内置的广告集成功能。通过Brightcove配置的广告策略现在只在基于web的播放器上可用,所以你必须自己做一些工作来将广告配置集成到iOS应用程序中。

为此,您需要从您的广告合作伙伴那里获取iOS库,并从工作室获取您的广告配置。然后,您可以设置提示点,您希望显示的广告:

代码语言:javascript
复制
// create a "before" cue point to play a pre-roll advertisement
BCCuePoint *cuePoint = [BCCuePoint 
                        cuePointWithPosition:@"before" 
                        type:@"ad"
                        properties:@{ @"adId": @"some-ad-configuration" }];
[emitter emit:BCEventSetCuePoint withDetails:@{ @"cuePoint": cuePoint }];

在显示广告之前,您应该倾听该提示点:

代码语言:javascript
复制
// Listen for a cue point to trigger an ad
[player.playbackEmitter on:BCEventCuePoint callBlock:^(BCEvent *event) {
    // Grab the cue point from the event
    BCCuePoint *cuePoint = [event.details objectForKey:@"cuePoint"];
    if ([cuePoint.type isEqualToString:@"ad"]) {
        [player pause];
        // Here's where you would call your native ad library to play an ad
        // This code will vary a lot depending on what ad library you're using
        [adLibrary playAd:cuePoint.properties[@"adId"]];
    }
}];

预先构建的IMA和FreeWheel插件正在开发中,因此值得询问您是否正在使用这两个提供商中的任何一个。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13056850

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档