SVSAdPlayerConfiguration

@interface SVSAdPlayerConfiguration : NSObject <NSCopying, NSCoding>

Configuration of the ad player.

  • Initialize a new instance of SVSAdPlayerConfiguration with the default configuration.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Return Value

    The initialized SVSAdPlayerConfiguration instance.

  • Initialize a new instance of SVSAdPlayerConfiguration from a JSON configuration.

    Any configuration parameter not defined in this JSON will be initialized with its default value, any additional parameter not supported in the SDK will be ignored.

    Declaration

    Objective-C

    - (nullable instancetype)initWithJSON:(nonnull NSString *)json;

    Parameters

    json

    A string containing an ad player configuration JSON.

    Return Value

    The initialized SVSAdPlayerConfiguration instance, or nil if the JSON is invalid.

  • Asynchronously retrieve a JSON based ad player configuration set from a given URL.

    Any configuration parameter not defined in this JSON will be initialized with its default value, any additional parameter not supported in the SDK will be ignored.

    Warning

    The execution thread for the completion handler is not guaranteed. If you make UI modification in this handler, make sure to perform them on the main thread.

    Declaration

    Objective-C

    + (void)adPlayerConfigurationFromURL:(nonnull NSURL *)adPlayerConfigurationURL
                       completionHandler:
                           (nonnull void (^)(SVSAdPlayerConfiguration *_Nullable,
                                             NSError *_Nullable))completionHandler;

    Parameters

    adPlayerConfigurationURL

    The URL of the JSON describing the ad player configuration.

    completionHandler

    The completion handler that will be called with the SVSAdPlayerConfiguration object.