Other Classes
The following classes are available globally.
-
The
APSAVPlayer
is a media backend renderer that handles playback via the nativeAVPlayer
classes. SeeAPSMediaPlayerProtocol
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
-
See moreAPSMediaOverlay
describes any overlay that theAPSMediaPlayer
instance needs to render during playback.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. TheAPSMediaPlayer
instance will query theactionDelegate
object to interpret and launch the specified URL. If theactionDelegate
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 toAPSButtonOverlay
set the overlay object’s
properties
property to aNSDictionary
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
ofNSURL
objects that will be tracked by the player when the overlay is tapped (see[APSMediaPlayer track:forEvent:type:]
). Note that thekAPSButtonOverlayClickthrough
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.
- kAPSButtonOverlayClickthrough: set this key to a
Declaration
Objective-C
@interface APSMediaPlayerButtonOverlayController : APSMediaPlayerOverlayController
Swift
class APSMediaPlayerButtonOverlayController : APSMediaPlayerOverlayController
- set the overlay object’s
-
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 moreDeclaration
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 toAPSHTMLOverlay
set the overlay object’s
properties
property to aNSDictionary
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
containingNSURL
s 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
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 toAPSImageOverlay
set the overlay object’s
properties
property to aNSDictionary
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
ofNSURL
objects that will be tracked by the player when the overlay is tapped (see[APSMediaPlayer track:forEvent:type:]
). Note that thekAPSImageOverlayClickthrough
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
ofNSURL
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
ofNSURL
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
toUIViewContentModeScaleAspectFit
- “aspectFill”, that will set the overlay’s
contentMode
toUIViewContentModeScaleAspectFill
- “fill”, that will set the overlay’s
contentMode
toUIViewContentModeScaleToFill
- “center”, that will set the overlay’s
contentMode
toUIViewContentModeCenter
- “bottom”, that will set the overlay’s
contentMode
toUIViewContentModeTop
- “top”, that will set the overlay’s
contentMode
toUIViewContentModeBottom
- “left”, that will set the overlay’s
contentMode
toUIViewContentModeLeft
- “right”, that will set the overlay’s
contentMode
toUIViewContentModeRight
- “aspectFit”, that will set the overlay’s
- kAPSImageOverlayClickthrough: set this key to a
Declaration
Objective-C
@interface APSMediaPlayerImageOverlayController : APSMediaPlayerClosableOverlayController
Swift
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
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 toAPSTextOverlay
set the overlay object’s
parameters
property to aNSDictionary
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.
- kAPSTextOverlayString: the
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
- 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
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 anAPSVASTMediaBuilderPlugin
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.
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 moreKRHub
object 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 theKRAdapter
protocol. Within a single group there can not be more objects that declare the same type.Declaration
Objective-C
@interface KRHub : NSObject
Swift
class KRHub : NSObject