Playout

  • Declaration

    Objective-C

    @interface OTVAVPlayer : AVPlayer
    /// Network analytics for the player
    @property (nonatomic, readonly, strong) OTVNetworkAnalytics * _Nullable networkAnalytics;
    /// Playback analytics for the player
    @property (nonatomic, readonly, strong) OTVPlaybackAnalytics * _Nullable playbackAnalytics;
    /// A view for rendering non-native subtitles to. This view should be at least as large as the relevant AVPlayerLayer.videoRect, but no wider.
    @property (nonatomic, strong) UIView * _Nullable subtitleView;
    /// :nodoc:
    /// Private init with AVPlayerItem which should not be called outside. Creates an instance of <code>OTVAVPlayer</code> using an <code>AVPlayerItem</code>.
    /// Make sure the item is initialized with OTVAVPlayerItem, otherwise a fatal error will be raised.
    /// \param item <code>AVPlayerItem</code> item to be played.
    ///
    - (nonnull instancetype)initWithPlayerItem:(AVPlayerItem * _Nullable)item OBJC_DESIGNATED_INITIALIZER;
    /// Creates an instance of <code>OTVAVPlayer</code> using a URL.
    /// note:
    /// Calling this function before loading the <code>OTVSDK</code> (with <code>OTVSDK.load()</code> or <code>OTVSDK.load(licence)</code>) will result in a playback error.
    /// \param URL URL of the content to be played.
    ///
    - (nonnull instancetype)initWithURL:(NSURL * _Nonnull)URL;
    /// Replaces the current item being played with another <code>AVPlayerItem</code>.
    /// note:
    /// the item should be an <code>OTVAVPlayerItem</code>, otherwise it will be ignored.
    /// \param item <code>AVPlayerItem</code> to be played.
    ///
    - (void)replaceCurrentItemWithPlayerItem:(AVPlayerItem * _Nullable)item;
    /// :nodoc:
    - (void)play;
    /// :nodoc:
    - (void)playImmediatelyAtRate:(float)rate;
    /// Returns an array of tracks available for the specified type.
    /// \param type The type of tracks to return
    ///
    - (NSArray<OTVTrackInfo *> * _Nonnull)tracksWithType:(enum OTVTrackType)type SWIFT_WARN_UNUSED_RESULT;
    /// Returns the selected track index for the specified type, or -1 if nothing is selected.
    /// \param type The type of track to return
    ///
    - (NSInteger)selectedTrackWithType:(enum OTVTrackType)type SWIFT_WARN_UNUSED_RESULT;
    /// Selects the specified track
    /// \param type The type of the track to select
    ///
    /// \param index The index of the track to select
    ///
    - (void)selectTrackWithType:(enum OTVTrackType)type index:(NSInteger)index;
    /// Deselects the specified track.
    /// \param type The type of the track to deselect
    ///
    /// \param index The index of the track to deselect
    ///
    - (void)deselectTrackWithType:(enum OTVTrackType)type index:(NSInteger)index;
    /// Registers a listener for when the tracks available change.
    /// The listener may be called at any point during playback.
    /// \param tracksChangedListener The listener
    ///
    - (void)registerWithTracksChangedListener:(id <OTVTracksChangedListener> _Nonnull)tracksChangedListener;
    /// Unregisters a listener for when the tracks available change
    /// \param tracksChangedListener The listener
    ///
    - (void)unregisterWithTracksChangedListener:(id <OTVTracksChangedListener> _Nonnull)tracksChangedListener;
    /// Add an external SRT subttile from a given URL
    /// \param subtitleURL The URL of the subtitle
    ///
    /// \param mimeType The mimeType of the subtitle
    ///
    /// \param language The Language of the subtitle
    ///
    - (void)addSubtitleWithUrl:(NSString * _Nonnull)subtitleURL mimeType:(NSString * _Nonnull)mimeType language:(NSString * _Nonnull)language;
    @end
  • OTVAVPlayerItem is derived from AVPlayerItem, please refer to apple’s documentation for further information.

    See more

    Declaration

    Objective-C

    
    @interface OTVAVPlayerItem : AVPlayerItem
  • OTVAVURLAsset is used for streams encrypted with Apple’s FairPlay Streaming (FPS). It is derived from AVURLAsset, please refer to apple’s documentation for further information.

    See more

    Declaration

    Objective-C

    
    @interface OTVAVURLAsset : AVURLAsset
  • A container view that creates an AVPlayerLayer and subtitle view, managing the interactions with OTVAVPlayer for easy integration. Optionally custom overlays can be added on top of the video/subtitle content through the ‘customOverlayView’ property. These views will sit below any optionally bound OTVWatermark. Any subviews added in storyboard or interface builder will be automatically moved onto the customOverlayView. Note that this process recreates any auto layout constraints so any constraints connected to an IBOutlet will be lost.

    See more

    Declaration

    Objective-C

    
    @interface OTVContainerView