AdVideoView

@objc(AASDKAdVideoView)
@MainActor
public class AdVideoView : UIView
extension AdVideoView: UIGestureRecognizerDelegate

The video view to render ads. It makes use of an internal AVPlayerLayer to be able to render video content on its own. Subclassing notes: AdVideoView can be subclassed; however, you must ensure it does not alter the base behaviour and presentation

  • An optional delegate object that receives state change notifications from an AdVideoView instance. Typically, this is an UIViewController instance. For best practice, this reference should be set to nil before deallocating the delegate.

    Declaration

    Swift

    @objc
    @IBOutlet
    @MainActor
    public weak var delegate: AdVideoViewDelegate?
  • The video aspect when used with the internal player layer. The default is aspectFit. Note that, if the internal player is not used, this property has no effect and you are responsible for managing the render aspect.

    Declaration

    Swift

    @objc
    @IBInspectable
    @MainActor
    public var aspect: AdVideoAspect { get set }
  • Returns the click-through URL for this video view if the loaded ad provides it

    Declaration

    Swift

    @objc
    @MainActor
    public var clickThrough: URL? { get }
  • The video state for viewability purposes. See the AdVideoState enum for possible values. Your AdVideoView instance will have to report state changes according to your specific usage. E.g whenever your video view transitions to one of the AdVideoState options, you should update the state here.

    Also note that, when your app transitions to the background, the SDK will conveniently set it to the minimized state and restore it to the previously known value when the app becomes active again.

    Declaration

    Swift

    @objc
    @MainActor
    public var state: AdVideoState { get set }
  • UIView Initializer. Overridden by AdswizzSDK.

    Declaration

    Swift

    @MainActor
    public override init(frame: CGRect)
  • UIView Initializer. Overridden by AdswizzSDK.

    Declaration

    Swift

    @MainActor
    public required init?(coder: NSCoder)
  • UIView Initializer. Overridden by AdswizzSDK.

    Declaration

    Swift

    @MainActor
    public override func awakeFromNib()
  • Call this method when you manually trigger the clickThrough URL (e.g you present a custom button in your interface and, when tapped, it will fire clickThrough as the target URL). This way, you inform the AdswizzSDK that the associated clickTrackings should also be fired for third-party measurement and reporting. Note that you may want to implement adVideoView(_ adVideoView: AdVideoView, shouldOverrideVideoClickThrough url: URL) -> Bool and return true to let the AdswizzSDK know that you’re responsible for handling the clickThrough.

    Declaration

    Swift

    @objc
    @MainActor
    public func didHandleClickThrough()
  • Registers a view that overlays or obstructs this container as “friendly” for viewability measurement purposes. See the Open Measurement in AdswizzSDK for guidance on what you are and what you are not allowed to register.

    Declaration

    Swift

    @objc
    @MainActor
    public func register(_ friendlyObstruction: AdVideoFriendlyObstruction)

    Parameters

    friendlyObstruction

    an obstruction to be marked as “friendly” until unregistered.

  • Unregisters all previously registered friendly obstructions.

    Declaration

    Swift

    @objc
    @MainActor
    public func unregisterAllFriendlyObstructions()
  • UIGestureRecognizerDelegate conformance. Implemented by AdswizzSDK.

    Declaration

    Swift

    @MainActor
    public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool
  • UIGestureRecognizerDelegate conformance. Implemented by AdswizzSDK.

    Declaration

    Swift

    @MainActor
    public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool