IMAStreamManager

@interface IMAStreamManager : NSObject

The IMAStreamManager class is responsible for playing streams.

  • The IMAStreamManagerDelegate to notify with events during stream playback.

    Declaration

    Swift

    weak var delegate: (NSObjectProtocol & IMAStreamManagerDelegate)! { get set }

    Objective-C

    @property (readwrite, nonatomic) NSObject<IMAStreamManagerDelegate> *delegate;
  • Identifier used during dynamic ad insertion to uniquely identify a stream. This can be used in the Stream Activity Monitor Debug Console to debug the stream session.

    Declaration

    Swift

    var streamId: String! { get }

    Objective-C

    @property (readonly, copy, nonatomic) NSString *streamId;
  • Initializes and loads the stream.

    Declaration

    Swift

    func initialize(with adsRenderingSettings: IMAAdsRenderingSettings!)

    Objective-C

    - (void)initializeWithAdsRenderingSettings:
        (IMAAdsRenderingSettings *)adsRenderingSettings;

    Parameters

    adsRenderingSettings

    the IMAAdsRenderingSettings. Pass in to influence ad rendering. Use nil to default to standard rendering.

  • Returns the stream time with ads for a given content time. Returns the given content time for live streams.

    Declaration

    Swift

    func streamTime(forContentTime contentTime: TimeInterval) -> TimeInterval

    Objective-C

    - (NSTimeInterval)streamTimeForContentTime:(NSTimeInterval)contentTime;

    Parameters

    contentTime

    the content time without any ads (in seconds)

    Return Value

    the stream time that corresponds with the given content time once ads are inserted

  • Returns the content time without ads for a given stream time. Returns the given stream time for live streams.

    Declaration

    Swift

    func contentTime(forStreamTime streamTime: TimeInterval) -> TimeInterval

    Objective-C

    - (NSTimeInterval)contentTimeForStreamTime:(NSTimeInterval)streamTime;

    Parameters

    streamTime

    the stream time with inserted ads (in seconds)

    Return Value

    the content time that corresponds with the given stream time once ads are removed

  • Returns the previous cuepoint for the given stream time. Retuns nil if no such cuepoint exists. This is used to implement features like snap back, and called when the publisher detects that the user seeked in order to force the user to watch an ad break they may have skipped over.

    Declaration

    Swift

    func previousCuepoint(forStreamTime streamTime: TimeInterval) -> IMACuepoint!

    Objective-C

    - (IMACuepoint *)previousCuepointForStreamTime:(NSTimeInterval)streamTime;

    Parameters

    streamTime

    the stream time that the was seeked to.

    Return Value

    the previous IMACuepoint for the given stream time.

  • Cleans the stream manager’s internal state for proper deallocation.

    Declaration

    Swift

    func destroy()

    Objective-C

    - (void)destroy;