SVSAdRuleData

Objective-C

@interface SVSAdRuleData : NSObject <NSCopying, NSCoding>

Swift

class SVSAdRuleData : NSObject, NSCopying, NSCoding

Represents the details of an ad rule related to a given ad break type.

Convenience initializers

  • Returns an initialized ad rule data object for a preroll ad break.

    Declaration

    Objective-C

    + (nullable instancetype)prerollDataWithInstances:(NSUInteger)instances;

    Swift

    class func prerollData(withInstances instances: UInt) -> Self?

    Parameters

    instances

    0 to disable the ad break, a positive number to override the default number of ads in the ad break.

    Return Value

    An initialized SVSAdRuleData instance.

  • Returns an initialized ad rule data object for a postroll ad break.

    Declaration

    Objective-C

    + (nullable instancetype)postrollDataWithInstances:(NSUInteger)instances;

    Swift

    class func postrollData(withInstances instances: UInt) -> Self?

    Parameters

    instances

    0 to disable the ad break, a positive number to override the default number of ads in the ad break.

    Return Value

    An initialized SVSAdRuleData instance.

  • Returns an initialized ad rule data object for a midroll ad break.

    Declaration

    Objective-C

    + (nullable instancetype)
        midrollDataWithInstances:(NSUInteger)instances
                        percents:(nonnull NSArray<NSNumber *> *)percents;

    Swift

    class func midrollData(withInstances instances: UInt, percents: [NSNumber]) -> Self?

    Parameters

    instances

    0 to disable the ad break, a positive number to override the default number of ads in the ad break.

    percents

    Array of percentages where the ad break should happen (irrelevant for streamed content).

    Return Value

    An initialized SVSAdRuleData instance.

  • Returns an initialized ad rule data object for a midroll ad break.

    Declaration

    Objective-C

    + (nullable instancetype)
        midrollDataWithInstances:(NSUInteger)instances
                       timecodes:(nonnull NSArray<NSString *> *)timecodes;

    Swift

    class func midrollData(withInstances instances: UInt, timecodes: [String]) -> Self?

    Parameters

    instances

    0 to disable the ad break, a positive number to override the default number of ads in the ad break.

    timecodes

    Array of timecodes where the ad break should happen (irrelevant for streamed content).

    Return Value

    An initialized SVSAdRuleData instance.

  • Returns an initialized ad rule data object for a midroll ad break.

    Note

    An offset of 0 will be set when using this initializer.

    Declaration

    Objective-C

    + (nullable instancetype)midrollDataWithInstances:(NSUInteger)instances
                                             interval:(NSTimeInterval)interval;

    Swift

    class func midrollData(withInstances instances: UInt, interval: TimeInterval) -> Self?

    Parameters

    instances

    0 to disable the ad break, a positive number to override the default number of ads in the ad break.

    interval

    Interval (in seconds) between two ad break.

    Return Value

    An initialized SVSAdRuleData instance.

  • Returns an initialized ad rule data object for a midroll ad break.

    Declaration

    Objective-C

    + (nullable instancetype)midrollDataWithInstances:(NSUInteger)instances
                                             interval:(NSTimeInterval)interval
                                               offset:(NSTimeInterval)offset;

    Swift

    class func midrollData(withInstances instances: UInt, interval: TimeInterval, offset: TimeInterval) -> Self?

    Parameters

    instances

    0 to disable the ad break, a positive number to override the default number of ads in the ad break.

    interval

    Interval (in seconds) between two ad break.

    offset

    Offset (in seconds) before the first ad break when an interval is defined.

    Return Value

    An initialized SVSAdRuleData instance.