Other Classes

The following classes are available globally.

  • The APSAVPlayer is a media backend renderer that handles playback via the native AVPlayer classes. See APSMediaPlayerProtocol for more details.

    To use, set up with the player shared instance:

        [sharedInstance setBackendPlayerClass:[APSAVPlayer class]];
    

    Declaration

    Objective-C

    @interface APSAVPlayer
        : NSObject <MPMediaPlayback, APSMediaPlayerProtocol, KRAdapter>

    Swift

    class APSAVPlayer : NSObject, MPMediaPlayback, APSMediaPlayerProtocol, KRAdapter
  • APSMediaOverlay describes any overlay that the APSMediaPlayer instance needs to render during playback.

    See more

    Declaration

    Objective-C

    @interface APSMediaOverlay : APSMediaEvent <NSCopying, APSMediaTrackableObject>

    Swift

    class APSMediaOverlay : APSMediaEvent, NSCopying, APSMediaTrackableObject
  • The APSMediaPlayerButtonOverlayController allows placing a transparent overlay in a specific area of the player surface, that can trigger the launch of a specific URL. The APSMediaPlayer instance will query the actionDelegate object to interpret and launch the specified URL. If the actionDelegate cannot respond to the URL, and the URL has a web scheme (http or https), it will be launched automatically in the in-app web browser.

    Configuration

    To create an APSMediaOverlay of button type:

    • set the overlay object’s type property to APSButtonOverlay
    • set the overlay object’s properties property to a NSDictionary that can have the following keys and values:

      • kAPSButtonOverlayClickthrough: set this key to a NSURL reprezenting the URL that should be launched when the overlay is tapped.
      • kAPSButtonOverlayClicktracking: set this key to a NSArray of NSURL objects that will be tracked by the player when the overlay is tapped (see [APSMediaPlayer track:forEvent:type:]). Note that the kAPSButtonOverlayClickthrough key must also be set for tracking to happen
      • kAPSButtonOverlayWebviewDismissAction: set this key to a NSNumber created from the APSWebviewDismissedAction value that defines the expected playlist behavior on in-app web browser dismiss.

    Declaration

    Objective-C

    @interface APSMediaPlayerButtonOverlayController
        : APSMediaPlayerOverlayController

    Swift

    class APSMediaPlayerButtonOverlayController : APSMediaPlayerOverlayController
  • The APSMediaPlayerClosableOverlayController class is meant to be a superclass for overlay controllers that need to display a configurable close button to remove the overlay from screen.

    The class adds a set of standard keys to any overlay controller’s own defined keys, to handle close button configuration. Methods are also exposed to allow a subclass to add and remove the close button from its view stack.

    See more

    Declaration

    Objective-C

    @interface APSMediaPlayerClosableOverlayController
        : APSMediaPlayerOverlayController

    Swift

    class APSMediaPlayerClosableOverlayController : APSMediaPlayerOverlayController
  • The APSMediaPlayerHTMLOverlayController allows the inline loading of HTML content inside an overlay placed on top of video content.

    Configuration

    To create an APSMediaOverlay of HTML type:

    • set the overlay object’s type property to APSHTMLOverlay
    • set the overlay object’s properties property to a NSDictionary that can have the following keys and values:

      • kAPSHTMLCodeContent: the actual HTML NSString to be loaded.
      • kAPSHTMLIframeSource: NSString containing the URL that should be loaded inside an iframe element.
      • kAPSHTMLScriptSource: NSString containing the URL of the JavaScript file that should be loaded and executed.
      • kAPSHTMLPageSource: NSString containing the URL to load directly in the webview container.
      • kAPSHTMLWidth: NSNumber corresponding to the integer value to be set for the meta viewport width property.
      • kAPSHTMLHeight: NSNumber corresponding to the integer value to be set for the meta viewport height property.
      • kAPSHTMLErrorURLs: NSArray containing NSURLs to be tracked in case of error.

    Declaration

    Objective-C

    @interface APSMediaPlayerHTMLOverlayController
        : APSMediaPlayerClosableOverlayController <WKNavigationDelegate>

    Swift

    class APSMediaPlayerHTMLOverlayController : APSMediaPlayerClosableOverlayController, WKNavigationDelegate
  • The APSMediaPlayerImageOverlayController allows placing an image on top of video content.

    Configuration

    To create an APSMediaOverlay of image type:

    • set the overlay object’s type property to APSImageOverlay
    • set the overlay object’s properties property to a NSDictionary that can have the following keys and values:

      • kAPSImageOverlayClickthrough: set this key to a NSURL reprezenting the URL that should be launched when the overlay is tapped.
      • kAPSImageOverlayClicktracking: set this key to a NSArray of NSURL objects that will be tracked by the player when the overlay is tapped (see [APSMediaPlayer track:forEvent:type:]). Note that the kAPSImageOverlayClickthrough key must also be set for tracking to happen.
      • kAPSImageOverlayWebviewDismissAction: set this key to a NSNumber created from the APSWebviewDismissedAction value that defines the expected playlist behavior on in-app web browser dismiss.
      • kAPSImageOverlayViewtracking: set this key to a NSArray of NSURL objects that will be tracked by the player when the overlay is displayed (see [APSMediaPlayer track:forEvent:type:]).
      • kAPSImageOverlayResourceURL: NSURL reprezenting the image to be loaded.
      • kAPSImageOverlayErrorURLs: set this key to a NSArray of NSURL objects that will be tracked by the player when there is an error loading the image (see [APSMediaPlayer track:forEvent:type:]).
      • kAPSImageOverlayBackgroundColor: the background color of the overlay. Set this to a NSString containing the hex color reprezentation. Defaults to [UIColor clearColor].
      • kAPSImageOverlayStretchMode: NSString reprezenting the possible ways of scaling the image in the overlay surface. Possible values are:
        • “aspectFit”, that will set the overlay’s contentMode to UIViewContentModeScaleAspectFit
        • “aspectFill”, that will set the overlay’s contentMode to UIViewContentModeScaleAspectFill
        • “fill”, that will set the overlay’s contentMode to UIViewContentModeScaleToFill
        • “center”, that will set the overlay’s contentMode to UIViewContentModeCenter
        • “bottom”, that will set the overlay’s contentMode to UIViewContentModeTop
        • “top”, that will set the overlay’s contentMode to UIViewContentModeBottom
        • “left”, that will set the overlay’s contentMode to UIViewContentModeLeft
        • “right”, that will set the overlay’s contentMode to UIViewContentModeRight

    Declaration

    Objective-C

    @interface APSMediaPlayerImageOverlayController
        : APSMediaPlayerClosableOverlayController

    Swift

    class APSMediaPlayerImageOverlayController : APSMediaPlayerClosableOverlayController
  • The superclass of all overlay controllers. Implements APSMediaPlayerOverlayControllerProtocol.

    See more

    Declaration

    Objective-C

    @interface APSMediaPlayerOverlayController
        : UIViewController <APSMediaPlayerOverlayControllerProtocol>

    Swift

    class APSMediaPlayerOverlayController : UIViewController, APSMediaPlayerOverlayControllerProtocol
  • The APSMediaPlayerTextOverlayController allows the displaying of text on top of video content.

    Configuration

    To create an APSMediaOverlay of text type:

    • set the overlay object’s type property to APSTextOverlay
    • set the overlay object’s parameters property to a NSDictionary that can have the following keys and values:

      • kAPSTextOverlayString: the NSString to be rendered.
      • kAPSTextOverlayStringColor: Font color for the rendered text. Set this to a NSString containing the hex color reprezentation. Defaults to [UIColor whiteColor].
      • kAPSTextOverlayStringFont: NSString indicating the font family to be used. Defaults to @“Helvetica”.
      • kAPSTextOverlayStringSize: NSNumber indicating the font size to be used. Defaults to 13.

    Replacable Placeholders

    The APSMediaPlayerTextOverlayController will replace the following string placeholders with dynamic information:

    • __remaining__ will be replaced with the remaining number of seconds for the current video clip being rendered.
    • __ad_index__ will be replaced with the current ad index within the ad break.
    • __total_ads__ will be replaced with the total number of ads within the ad break.

    Declaration

    Objective-C

    @interface APSMediaPlayerTextOverlayController : APSMediaPlayerOverlayController

    Swift

    class APSMediaPlayerTextOverlayController : APSMediaPlayerOverlayController
  • Holds all configuration parameters for the banner ads displayed.

    See more

    Declaration

    Objective-C

    @interface APSVASTBannerConfiguration : NSObject <NSCopying>

    Swift

    class APSVASTBannerConfiguration : NSObject, NSCopying
  • Holds all configuration parameters for the coundown overlay displayed on top of video ads.

    See more

    Declaration

    Objective-C

    @interface APSVASTCountdownConfiguration : NSObject <NSCopying>

    Swift

    class APSVASTCountdownConfiguration : NSObject, NSCopying
  • The VAST Media Builder plugin extends an APSMediaBuilder object by inserting preroll, postroll, midroll and non-linear ad breaks, loaded from VAST 1.0, VAST 2.0, VAST 3.0 and VMAP 1.0 sources.

    Use the [APSMediaBuilder addPlugin:] method to attach an APSVASTMediaBuilderPlugin object to a media builder.

    Configuration of the plugin can be done in three ways:

    • programatically configure the plugin object, using available properties;
    • configure the plugin object directly, using a dictionary - see [APSMediaBuilderPlugin configureFromDictionary:];
    • configure the plugin with JSON. This is done as part of the APSMediaBuilder object configuration from JSON or from a dictionary. If the supplied configuration dictionary or interpreted JSON dictionary contains the “ads” key, then the corresponding value dictionary for that key will be provided to the plugin for configuration.
    See more

    Declaration

    Objective-C

    @interface APSVASTMediaBuilderPlugin : NSObject <APSMediaBuilderPlugin>

    Swift

    class APSVASTMediaBuilderPlugin : NSObject, APSMediaBuilderPlugin
  • Holds all configuration parameters for the skip button displayed on top of video ads

    See more

    Declaration

    Objective-C

    @interface APSVASTSkipButtonConfiguration : NSObject <NSCopying>

    Swift

    class APSVASTSkipButtonConfiguration : NSObject, NSCopying
  • A KRHub object can easily become a container of references to other objects or classes, organized in groups. To be able to register themselves with a KRHub, objects must implement the KRAdapter protocol. Within a single group there can not be more objects that declare the same type.

    See more

    Declaration

    Objective-C

    @interface KRHub : NSObject

    Swift

    class KRHub : NSObject