有人知道如何在新的Brightcove iOS SDK中的BCPlayerView / BCVideo / BCPlayerItem中实现对广告的调用吗?我可以在哪里指定广告服务器?这需要在Brightcove Studio中完成吗?
发布于 2012-10-26 02:23:33
Brightcove iOS player目前还没有内置的广告集成功能。通过Brightcove配置的广告策略现在只在基于web的播放器上可用,所以你必须自己做一些工作来将广告配置集成到iOS应用程序中。
为此,您需要从您的广告合作伙伴那里获取iOS库,并从工作室获取您的广告配置。然后,您可以设置提示点,您希望显示的广告:
// 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 }];在显示广告之前,您应该倾听该提示点:
// 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插件正在开发中,因此值得询问您是否正在使用这两个提供商中的任何一个。
https://stackoverflow.com/questions/13056850
复制相似问题