Skip to main content

BBRendererState

class BBRendererState

Reactive state holder for BBNativeRendererView (outstream/ad renderer).

Create with @State private var rendererState = BBRendererState().

Important: Call destroy() from .onDisappear to ensure timely cleanup of SDK resources, or use the convenience BBNativeRenderer/init(jsonUrl:options:) initializer for automatic lifecycle management.

Functions

bootstrap

func bootstrap(config: [String: String], playoutOverrides: [String: Any]? = nil)

Bootstrap the renderer with a VAST ad configuration.

Call this after the renderer is ready (observe isReady). The config dictionary must contain a "code" key and at least one of "vastUrl" or "vastXml". If called before the renderer is ready or after it has been destroyed, the call is ignored and an error is logged.

  • Parameters:
  • config: Dictionary with keys "code", "vastUrl" and/or "vastXml", and optionally "vastSubtype".
  • playoutOverrides: Optional overrides for playout settings.

destroy

func destroy()

Destroy the renderer and release resources.

Properties

isAdPlaying

internal(set) var isAdPlaying: Bool

Whether an ad is currently playing. Updated via the renderer's player view delegate callbacks.