2

Does anyone know how to implement the call to advertising within a BCPlayerView / BCVideo / BCPlayerItem in the new Brightcove iOS SDK. Where can I specify the ad server? Does this need to be done in the Brightcove Studio?

regandc
  • 21
  • 1

1 Answers1

1

The 3.0 Brightcove iOS player doesn't have built-in integrations for ads right now. Ad policies configured through Brightcove are only available on the web-based players today so you have to do some work yourself to integrate that ad configuration in an iOS app.

To do that, you'd need to grab the iOS library from your ad partner and your ad configuration from the Studio. Then you can set cue points where you'd like an ad to show up:

// 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 }];

You would listen for that cue point before displaying the ad:

// 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"]];
    }
}];

Pre-built IMA and FreeWheel plugins are on the way so it's worth asking about if you're using either one of those providers.

dml
  • 469
  • 2
  • 3