SASBannerViewInternalDelegate

Objective-C

@protocol SASBannerViewInternalDelegate <NSObject>

Swift

protocol SASBannerViewInternalDelegate : NSObjectProtocol

Internal SASBannerView delegate.

This delegate can be used to retrieve internal views and events of the SDK. It should only be implemented to if you are using a third party SDK responsible to measure some stats on your ads SDKs.

Warning

Views and objects retrieved from these methods should never be used for anything else than viewability and performance measurement. These internal objects might change without warning in future SDK version.
  • Notifies the delegate that the banner view will start playing native video.

    Implement this method if you want to know when an banner view starts playing native video (e.g. from a native video).

    This is useful if you want to track on your side the AVPlayer behaviour.

    Warning

    Interacting with the AVPlayer instance can lead to unexpected behaviour. This method will only be triggered by native video creatives, not by HTML based creatives.

    Declaration

    Objective-C

    - (void)bannerView:(nonnull SASBannerView *)bannerView
        willPlayVideoWithAVPlayer:(nonnull AVPlayer *)player
                  withPlayerLayer:(nonnull CALayer *)playerLayer
               withContainingView:(nonnull UIView *)containingView;

    Swift

    func bannerView(_ bannerView: SASBannerView, willPlayVideoWith player: AVPlayer, withPlayerLayer playerLayer: CALayer, withContaining containingView: UIView)

    Parameters

    bannerView

    The instance of SASBannerView that called this delegate method.

    player

    The AVPlayer instance responsible for playing the video.

    playerLayer

    A CALayer inheriting instance. AVPlayerLayer class for standard native videos. CALayer class for 360° native videos.

    containingView

    The UIView which is going to contain the video layer.

  • Notifies the delegate that the layer rendering the current native video ad did change to a new CALayer instance and/or a new container view.

    This method will be called for Video-Read ads when they enter fullscreen.

    Implement this method if you want to know when a playing native video ad changes its rendering layer or its hierarchical parent.

    This is useful if you want to track the viewability of the video ad.

    Warning

    Interacting with the AVPlayer instance can lead to unexpected behaviour. This method will only be triggered by native video creatives, not by HTML based creatives.

    Declaration

    Objective-C

    - (void)bannerView:(nonnull SASBannerView *)bannerView
                  withAVPlayer:(nonnull AVPlayer *)player
        didSwitchToPlayerLayer:(nonnull CALayer *)playerLayer
            withContainingView:(nonnull UIView *)containingView;

    Swift

    func bannerView(_ bannerView: SASBannerView, with player: AVPlayer, didSwitchToPlayerLayer playerLayer: CALayer, withContaining containingView: UIView)

    Parameters

    bannerView

    The instance of SASBannerView that called this delegate method.

    player

    The AVPlayer instance responsible for playing the video.

    playerLayer

    A CALayer inheriting instance where the video is rendered. AVPlayerLayer class for standard native videos. CALayer class for 360° native videos.

    containingView

    The UIView which is going to contain the video layer.