NitroAd placement.

Constructors

  • Do not call this directly. Use createAd to create placements.

    Parameters

    Returns NitroAd

Properties

id: string

The unique id attribute for this placement.

Placement settings.

Methods

  • In single-page applications, this can be called to clear and refresh the placement when navigating to a different URL. Passing in a href prop for an interstitial format will navigate to the given href after the interstitial is dismissed.

    Parameters

    • Optionalhref: string

    Returns void

    In an SPA, where navigating to a new page doesn't trigger a full page refresh, you can keep a reference to the NitroAd object you receive when calling createAd, and call this from your framework's navigation event.

    Alternatively, you can remove the container div from the DOM, then recreate it and call createAd again. The div being removed will be detected, and any related resources will be freed.

  • returns true if ad rendering should continue returns false if ad rendering should be halted

    Returns Promise<boolean>

    boolean

  • Merge config into the live Aniview video player in real time. Only valid on video or video-nc format placements — logs an error otherwise. Safe to call at any time after the unit renders; calling before the player is initialized is a no-op (the Aniview module will log a warning).

    Parameters

    Returns void

    const ad = await window.nitroAds.createAd('unit-1', { format: 'video', ... });
    ad.videoConfig({ floating: { top: 80 } });