SVSAdRule

@interface SVSAdRule : NSObject <NSCopying, NSCoding>

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

  • Returns a SVSAdRule instance.

    Declaration

    Objective-C

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

    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;

    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;

    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;

    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;

    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.

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

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSTimeInterval durationMin;
  • The maximum duration of the media for this ad rule (-1 means no maximum duration).

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSTimeInterval durationMax;
  • 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 (readonly, nonatomic) NSTimeInterval minimumDelayBetweenAdBreaks;
  • Returns all rule data objects of this ad rule (see SVSAdRuleData).

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSArray<SVSAdRuleData *> *_Nonnull data;
  • The preroll data object of this ad rule if any, nil otherwise.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) SVSAdRuleData *prerollData;
  • The midroll data object of this ad rule if any, nil otherwise.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) SVSAdRuleData *midrollData;
  • The postroll data object of this ad rule if any, nil otherwise.

    Declaration

    Objective-C

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