Other Classes
The following classes are available globally.
-
The
APSAVPlayeris a media backend renderer that handles playback via the nativeAVPlayerclasses. SeeAPSMediaPlayerProtocolfor 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 -
See moreAPSMediaOverlaydescribes any overlay that theAPSMediaPlayerinstance needs to render during playback.Declaration
Objective-C
@interface APSMediaOverlay : APSMediaEvent <NSCopying, APSMediaTrackableObject>Swift
class APSMediaOverlay : APSMediaEvent, NSCopying, APSMediaTrackableObject -
The
APSMediaPlayerButtonOverlayControllerallows placing a transparent overlay in a specific area of the player surface, that can trigger the launch of a specific URL. TheAPSMediaPlayerinstance will query theactionDelegateobject to interpret and launch the specified URL. If theactionDelegatecannot 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
APSMediaOverlayof button type:- set the overlay object’s
typeproperty toAPSButtonOverlay set the overlay object’s
propertiesproperty to aNSDictionarythat can have the following keys and values:- kAPSButtonOverlayClickthrough: set this key to a
NSURLreprezenting the URL that should be launched when the overlay is tapped. - kAPSButtonOverlayClicktracking: set this key to a
NSArrayofNSURLobjects that will be tracked by the player when the overlay is tapped (see[APSMediaPlayer track:forEvent:type:]). Note that thekAPSButtonOverlayClickthroughkey must also be set for tracking to happen - kAPSButtonOverlayWebviewDismissAction: set this key to a NSNumber created from the
APSWebviewDismissedActionvalue that defines the expected playlist behavior on in-app web browser dismiss.
- kAPSButtonOverlayClickthrough: set this key to a
Declaration
Objective-C
@interface APSMediaPlayerButtonOverlayController : APSMediaPlayerOverlayControllerSwift
class APSMediaPlayerButtonOverlayController : APSMediaPlayerOverlayController - set the overlay object’s
-
The
APSMediaPlayerClosableOverlayControllerclass 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 moreDeclaration
Objective-C
@interface APSMediaPlayerClosableOverlayController : APSMediaPlayerOverlayControllerSwift
class APSMediaPlayerClosableOverlayController : APSMediaPlayerOverlayController -
The
APSMediaPlayerHTMLOverlayControllerallows the inline loading of HTML content inside an overlay placed on top of video content.Configuration
To create an
APSMediaOverlayof HTML type:- set the overlay object’s
typeproperty toAPSHTMLOverlay set the overlay object’s
propertiesproperty to aNSDictionarythat can have the following keys and values:- kAPSHTMLCodeContent: the actual HTML
NSStringto be loaded. - kAPSHTMLIframeSource:
NSStringcontaining the URL that should be loaded inside an iframe element. - kAPSHTMLScriptSource:
NSStringcontaining the URL of the JavaScript file that should be loaded and executed. - kAPSHTMLPageSource:
NSStringcontaining the URL to load directly in the webview container. - kAPSHTMLWidth:
NSNumbercorresponding to the integer value to be set for the meta viewport width property. - kAPSHTMLHeight:
NSNumbercorresponding to the integer value to be set for the meta viewport height property. - kAPSHTMLErrorURLs:
NSArraycontainingNSURLs to be tracked in case of error.
- kAPSHTMLCodeContent: the actual HTML
Declaration
Objective-C
@interface APSMediaPlayerHTMLOverlayController : APSMediaPlayerClosableOverlayController <WKNavigationDelegate>Swift
class APSMediaPlayerHTMLOverlayController : APSMediaPlayerClosableOverlayController, WKNavigationDelegate - set the overlay object’s
-
The
APSMediaPlayerImageOverlayControllerallows placing an image on top of video content.Configuration
To create an
APSMediaOverlayof image type:- set the overlay object’s
typeproperty toAPSImageOverlay set the overlay object’s
propertiesproperty to aNSDictionarythat can have the following keys and values:- kAPSImageOverlayClickthrough: set this key to a
NSURLreprezenting the URL that should be launched when the overlay is tapped. - kAPSImageOverlayClicktracking: set this key to a
NSArrayofNSURLobjects that will be tracked by the player when the overlay is tapped (see[APSMediaPlayer track:forEvent:type:]). Note that thekAPSImageOverlayClickthroughkey must also be set for tracking to happen. - kAPSImageOverlayWebviewDismissAction: set this key to a NSNumber created from the
APSWebviewDismissedActionvalue that defines the expected playlist behavior on in-app web browser dismiss. - kAPSImageOverlayViewtracking: set this key to a
NSArrayofNSURLobjects that will be tracked by the player when the overlay is displayed (see[APSMediaPlayer track:forEvent:type:]). - kAPSImageOverlayResourceURL:
NSURLreprezenting the image to be loaded. - kAPSImageOverlayErrorURLs: set this key to a
NSArrayofNSURLobjects 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
NSStringcontaining the hex color reprezentation. Defaults to[UIColor clearColor]. - kAPSImageOverlayStretchMode:
NSStringreprezenting the possible ways of scaling the image in the overlay surface. Possible values are:- “aspectFit”, that will set the overlay’s
contentModetoUIViewContentModeScaleAspectFit - “aspectFill”, that will set the overlay’s
contentModetoUIViewContentModeScaleAspectFill - “fill”, that will set the overlay’s
contentModetoUIViewContentModeScaleToFill - “center”, that will set the overlay’s
contentModetoUIViewContentModeCenter - “bottom”, that will set the overlay’s
contentModetoUIViewContentModeTop - “top”, that will set the overlay’s
contentModetoUIViewContentModeBottom - “left”, that will set the overlay’s
contentModetoUIViewContentModeLeft - “right”, that will set the overlay’s
contentModetoUIViewContentModeRight
- “aspectFit”, that will set the overlay’s
- kAPSImageOverlayClickthrough: set this key to a
Declaration
Objective-C
@interface APSMediaPlayerImageOverlayController : APSMediaPlayerClosableOverlayControllerSwift
class APSMediaPlayerImageOverlayController : APSMediaPlayerClosableOverlayController - set the overlay object’s
-
The superclass of all overlay controllers. Implements
See moreAPSMediaPlayerOverlayControllerProtocol.Declaration
Objective-C
@interface APSMediaPlayerOverlayController : UIViewController <APSMediaPlayerOverlayControllerProtocol>Swift
class APSMediaPlayerOverlayController : UIViewController, APSMediaPlayerOverlayControllerProtocol -
The
APSMediaPlayerTextOverlayControllerallows the displaying of text on top of video content.Configuration
To create an
APSMediaOverlayof text type:- set the overlay object’s
typeproperty toAPSTextOverlay set the overlay object’s
parametersproperty to aNSDictionarythat can have the following keys and values:- kAPSTextOverlayString: the
NSStringto be rendered. - kAPSTextOverlayStringColor: Font color for the rendered text. Set this to a
NSStringcontaining the hex color reprezentation. Defaults to[UIColor whiteColor]. - kAPSTextOverlayStringFont:
NSStringindicating the font family to be used. Defaults to @“Helvetica”. - kAPSTextOverlayStringSize:
NSNumberindicating the font size to be used. Defaults to 13.
- kAPSTextOverlayString: the
Replacable Placeholders
The
APSMediaPlayerTextOverlayControllerwill 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 : APSMediaPlayerOverlayControllerSwift
class APSMediaPlayerTextOverlayController : APSMediaPlayerOverlayController - set the overlay object’s
-
Holds all configuration parameters for the banner ads displayed.
See moreDeclaration
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 moreDeclaration
Objective-C
@interface APSVASTCountdownConfiguration : NSObject <NSCopying>Swift
class APSVASTCountdownConfiguration : NSObject, NSCopying -
The VAST Media Builder plugin extends an
APSMediaBuilderobject 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 anAPSVASTMediaBuilderPluginobject 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
APSMediaBuilderobject 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.
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 moreDeclaration
Objective-C
@interface APSVASTSkipButtonConfiguration : NSObject <NSCopying>Swift
class APSVASTSkipButtonConfiguration : NSObject, NSCopying -
A
See moreKRHubobject can easily become a container of references to other objects or classes, organized in groups. To be able to register themselves with aKRHub, objects must implement theKRAdapterprotocol. Within a single group there can not be more objects that declare the same type.Declaration
Objective-C
@interface KRHub : NSObjectSwift
class KRHub : NSObject
Other Classes Reference