VideoInterstitialAdUnit

Create a new Video Outstream Ad Unit associated with a Prebid Server configuration ID and a video size.

Video Insterstital is only supported with Google Ad Manager.

VideoInterstitialAdUnit(configId: String)

Parameters

configId(String): Prebid Server configuration ID.

See AdUnit for additional parameters and methods.


Example

Google Mobile Ads
Import the GoogleMobileAds from google-mobile-sdk into the UIViewController displaying the VideoInterstitialAdUnit.

Swift

    var adUnit: AdUnit!
    var amInterstitial: DFPInterstitial!

    func setupAndLoadAMInterstitialVAST() {

        setupPBInterstitialVAST()
        setupAMInterstitialVAST()

        loadInterstitial()
    }

    func setupPBInterstitialVAST() {
        Prebid.shared.prebidServerHost = .Rubicon
        Prebid.shared.prebidServerAccountId = "accountId"
        adUnit = VideoInterstitialAdUnit(configId: "configId")
    }

    func setupAMInterstitialVAST() {
        amInterstitial = DFPInterstitial(adUnitID: "/5300653/test_adunit_vast_pavliuchyk")
    }

    func loadInterstitial() {

        adUnit.fetchDemand(adObject: self.request) { (resultCode: ResultCode) in
            print("Prebid demand fetch for DFP \(resultCode.name())")
        }
    }