SVSAdRule

Objective-C

@interface SVSAdRule : NSObject <NSCopying, NSCoding>

Swift

class SVSAdRule : NSObject, NSCopying, NSCoding

Represents an ad rule for a particular media duration. All durations are expressed in seconds.

Convenience initializers

  • Returns a SVSAdRule instance.

    Declaration

    Objective-C

    + (nullable instancetype)adRuleWithData:(nonnull NSArray<SVSAdRuleData *> *)data
                                durationMin:(NSTimeInterval)durationMin
                                durationMax:(NSTimeInterval)durationMax
                minimumDelayBetweenAdBreaks:
                    (NSTimeInterval)minimumDelayBetweenAdBreaks;

    Swift

    convenience init?(data: [SVSAdRuleData], durationMin: TimeInterval, durationMax: TimeInterval, minimumDelayBetweenAdBreaks: TimeInterval)

    Parameters

    data

    The data of the ad rule (see SVSAdRuleData).

    durationMin

    The minimum duration of the media for this ad rule.

    durationMax

    The maximum duration of the media for this ad rule (kSVSAdRuleInfiniteDuration means no maximum duration).

    minimumDelayBetweenAdBreaks

    The minimum duration of content’s playback between two linear Ad Breaks for this ad rule.

    Return Value

    An initialized SVSAdRule instance.

  • Returns a SVSAdRule instance.

    Declaration

    Objective-C

    + (nullable instancetype)adRuleWithData:(nonnull NSArray<SVSAdRuleData *> *)data
                                durationMin:(NSTimeInterval)durationMin
                                durationMax:(NSTimeInterval)durationMax;

    Swift

    convenience init?(data: [SVSAdRuleData], durationMin: TimeInterval, durationMax: TimeInterval)

    Parameters

    data

    The data of the ad rule (see SVSAdRuleData).

    durationMin

    The minimum duration of the media for this ad rule.

    durationMax

    The maximum duration of the media for this ad rule (kSVSAdRuleInfiniteDuration means no maximum duration).

    Return Value

    An initialized SVSAdRule instance.

  • Returns a SVSAdRule instance without minimum duration constraint.

    Declaration

    Objective-C

    + (nullable instancetype)adRuleWithData:(nonnull NSArray<SVSAdRuleData *> *)data
                                durationMax:(NSTimeInterval)durationMax;

    Swift

    convenience init?(data: [SVSAdRuleData], durationMax: TimeInterval)

    Parameters

    data

    The data of the ad rule (see SVSAdRuleData).

    durationMax

    The maximum duration of the media for this ad rule (kSVSAdRuleInfiniteDuration means no maximum duration).

    Return Value

    An initialized SVSAdRule instance.

  • Returns a SVSAdRule instance without maximum duration constraint.

    Declaration

    Objective-C

    + (nullable instancetype)adRuleWithData:(nonnull NSArray<SVSAdRuleData *> *)data
                                durationMin:(NSTimeInterval)durationMin;

    Swift

    convenience init?(data: [SVSAdRuleData], durationMin: TimeInterval)

    Parameters

    data

    The data of the ad rule (see SVSAdRuleData).

    durationMin

    The minimum duration of the media for this ad rule.

    Return Value

    An initialized SVSAdRule instance.

  • Returns a SVSAdRule instance for a live stream content.

    Declaration

    Objective-C

    + (nullable instancetype)adRuleForLiveStreamContentWithData:
                                 (nonnull NSArray<SVSAdRuleData *> *)data
                                    minimumDelayBetweenAdBreaks:
                                        (NSTimeInterval)minimumDelayBetweenAdBreaks;

    Swift

    convenience init?(forLiveStreamContentWithData data: [SVSAdRuleData], minimumDelayBetweenAdBreaks: TimeInterval)

    Parameters

    data

    The data of the ad rule (see SVSAdRuleData).

    minimumDelayBetweenAdBreaks

    The minimum duration of content’s playback between two linear Ad Breaks for this ad rule.

    Return Value

    An initialized SVSAdRule instance.

Ad rule properties

  • The minimum duration of the media for this ad rule.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSTimeInterval durationMin;

    Swift

    var durationMin: TimeInterval { get }
  • The maximum duration of the media for this ad rule (-1 means no maximum duration).

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSTimeInterval durationMax;

    Swift

    var durationMax: TimeInterval { get }
  • The minimum duration between 2 Midrolls breaks to avoid users seeking through content to hit too many breaks. (default: 0 second).

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSTimeInterval minimumDelayBetweenAdBreaks;

    Swift

    var minimumDelayBetweenAdBreaks: TimeInterval { get }
  • Returns all rule data objects of this ad rule (see SVSAdRuleData).

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<SVSAdRuleData *> *_Nonnull data;

    Swift

    var data: [SVSAdRuleData] { get }
  • The preroll data object of this ad rule if any, nil otherwise.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) SVSAdRuleData *prerollData;

    Swift

    var prerollData: SVSAdRuleData? { get }
  • The midroll data object of this ad rule if any, nil otherwise.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) SVSAdRuleData *midrollData;

    Swift

    var midrollData: SVSAdRuleData? { get }
  • The postroll data object of this ad rule if any, nil otherwise.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) SVSAdRuleData *postrollData;

    Swift

    var postrollData: SVSAdRuleData? { get }