SCSimpleAdController

@interface SCSimpleAdController
    : NSObject <SCAdSessionStateListener, SCAdListener>

Use this class to simplify ad playback for standalone players (or as a base class for any other type of adController based playback)

  • init with sessionController instance

    Declaration

    Objective-C

    - (nonnull instancetype)initWithSessionController:
        (nonnull SCAdSessionController *)sessionController;
  • set the facade delegate (your PlayerController e.g. AVPlayerController)

    Declaration

    Objective-C

    - (void)setFacadeDelegate:(nonnull id<SCAdFacadeDelegate>)facadeDelegate;
  • set the configuration for the upcoming adSlot

    Declaration

    Objective-C

    - (void)setConfiguration:(nonnull SCAdConfiguration *)configuration;
  • set the player view that holds the (AV)player

    Declaration

    Objective-C

    - (void)setPlayerView:(id)view;
  • add every view to the friendly views array that covers the adView

    Declaration

    Objective-C

    - (void)registerFriendlyViews:(nonnull NSMutableArray *)views;
  • call resize every time the size of the player changes

    Declaration

    Objective-C

    - (void)resize;
  • call to toggle mute/unmute

    Declaration

    Objective-C

    - (void)mute;
  • call to skip the ad (if the skipButton is visible)

    Declaration

    Objective-C

    - (void)skip;
  • call to open clickThrough alert when user taps on player

    Declaration

    Objective-C

    - (void)onClickThrough;
  • check if the player is currently muted

    Declaration

    Objective-C

    - (BOOL)isMuted;
  • get duration of the current clip

    Declaration

    Objective-C

    - (double)getDuration;
  • call this function to stop the adSlot

    Declaration

    Objective-C

    - (void)stopAdSlot;
  • call this function to cleanup everything

    Declaration

    Objective-C

    - (void)cleanup;
  • if an error occured (event ON_AD_ERROR) a more detailed error description can be accessed here

    Declaration

    Objective-C

    - (void)getAdError:(nonnull SCAdErrorCompletionBlock)completion;
  • get the clickThrough url

    Declaration

    Objective-C

    - (void)clickThroughURL:(nonnull SCStringResultCompletionBlock)completion;
  • pause advertisement playback

    Declaration

    Objective-C

    - (void)pauseAdPlayback;
  • resume advertisement playback

    Declaration

    Objective-C

    - (void)resumeAdPlayback;
  • Undocumented

    Declaration

    Objective-C

    - (void)displayRealProgress;
  • Undocumented

    Declaration

    Objective-C

    - (double)setProgressValuesAndGetUpdateInterval:(SCPublicAdSlot*_Nonnull)adSlot;
  • Undocumented

    Declaration

    Objective-C

    - (void)stopProgressTimer;
  • set your delegate

    Declaration

    Objective-C

    @property (nonatomic, weak) id<SCAdControllerDelegate> _Nullable delegate;
  • if you want to log detailed information, set a logging delegate

    Declaration

    Objective-C

    @property (nonatomic, weak) id<SCAdControllerLoggingDelegate> _Nullable loggingDelegate;
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) double allOverDuration
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) double progress
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) double recentClipsTime
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) SCAdConfiguration * _Nullable config
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) SCAdSessionController * _Nullable sessionController
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) SCAdSlotController * _Nullable adSlotController
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, weak) id<SCAdFacadeDelegate> _Nullable avPlayerController
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) NSTimer * _Nullable progressTimer