BMPSourceItem

Objective-C


@interface BMPSourceItem : NSObject <BMPJsonable>

Swift

class SourceItem : NSObject, BMPJsonable

Represents a source item which can be played back in a player instance.

  • The title of the video source.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSString *itemTitle;

    Swift

    var itemTitle: String? { get set }
  • The description of the video source.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSString *itemDescription;

    Swift

    var itemDescription: String? { get set }
  • The HLS source for this source item. HLS content can easily and for free be generated using Bitmovin’s video encoding solution.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) BMPHLSSource *hlsSource;

    Swift

    var hlsSource: HLSSource? { get }
  • The DASH source for this source item which can ONLY be used for remote playback (e.g. Chromecast). DASH content can easily and for free be generated using Bitmovin’s video encoding solution.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) BMPDASHSource *dashSource;

    Swift

    var dashSource: DASHSource? { get }
  • An array of progressive multimedia sources which are used as fallback when no HLS source is set.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSArray<BMPProgressiveSource *> *progressiveSources;

    Swift

    var progressiveSources: [ProgressiveSource]? { get }
  • The URL to a preview image displayed until the video starts.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSURL *posterSource;

    Swift

    var posterSource: URL? { get set }
  • Indicates whether to show the poster image during playback. Useful, for example, for audio-only streams.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isPosterPersistent) BOOL persistentPoster;

    Swift

    var isPosterPersistent: Bool { get set }
  • Configuration for audio and subtitle track labels.

    Declaration

    Objective-C

    @property (nonatomic, strong, nonnull) BMPLabelingConfiguration *labelingConfiguration;

    Swift

    var labelingConfiguration: LabelingConfiguration { get set }
  • The DRM configuration for the main source.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSArray<BMPDRMConfiguration *> *drmConfigurations;

    Swift

    var drmConfigurations: [DRMConfiguration]? { get }
  • An array of timed data, such as thumbnail- or subtitle tracks.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSArray<BMPTrack *> *tracks;

    Swift

    var tracks: [Track] { get }
  • The thumbnail track for this source item

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) BMPThumbnailTrack *thumbnailTrack;

    Swift

    var thumbnailTrack: ThumbnailTrack? { get set }
  • Holds metadata for this source item. This data can be used by the player UI to display additional information about the currently played source.

    When objects of type AVMetadataItem are passed as values to the metadata dictionary, they are set as externalMetadata on the AVPlayerItem on tvOS.

    When SourceItem is used for GoogleCast with V3 receiver, all values must be an instance of NSString.

    See BMPMetadataIdentifier for more supported attributes.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSMutableDictionary<NSString *, id<NSObject, NSCopying>> *_Nonnull metadata;

    Swift

    @NSCopying var metadata: NSMutableDictionary { get set }
  • An object specifying advanced source specific options.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) BMPSourceOptions *options;

    Swift

    var options: SourceOptions? { get set }
  • Creates a new BMPSourceItem based on the given source URL.

    Declaration

    Objective-C

    - (nullable instancetype)initWithUrl:(nonnull NSURL *)url;

    Swift

    init?(url: URL)

    Parameters

    url

    The URL for the media source.

    Return Value

    A new source item initialized with the given URL, or nil on failure.

  • Creates a new BMPSourceItem based on the given adaptive source.

    Declaration

    Objective-C

    - (nullable instancetype)initWithAdaptiveSource:
        (nonnull BMPAdaptiveSource *)adaptiveSource;

    Swift

    init?(adaptiveSource: AdaptiveSource)

    Parameters

    adaptiveSource

    The adaptive source for the source configuration.

    Return Value

    A new source item initialized with the given adaptive source, or nil on failure.

  • Creates a new BMPSourceItem based on the given HLS source.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithHLSSource:(nonnull BMPHLSSource *)hlsSource;

    Swift

    init(hlsSource: HLSSource)

    Parameters

    hlsSource

    The HLS source for this source configuration.

    Return Value

    A new source item initialized with the given HLS source.

  • Creates a new BMPSourceItem based on the given DASH source.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDASHSource:(nonnull BMPDASHSource *)dashSource;

    Swift

    init(dashSource: DASHSource)

    Parameters

    dashSource

    The DASH source for this source configuration.

    Return Value

    A new source item initialized with the given DASH source.

  • Creates a new BMPSourceItem based on the given progressive source.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithProgressiveSource:
        (nonnull BMPProgressiveSource *)progressiveSource;

    Swift

    init(progressiveSource: ProgressiveSource)

    Parameters

    progressiveSource

    The progressive source for this source configuration.

    Return Value

    A new source item initialized with the given progressive source.

  • Creates a new BMPSourceItem based on the given progressive sources.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithProgressiveSources:
        (nonnull NSArray<BMPProgressiveSource *> *)progressiveSources;

    Swift

    init(progressiveSources: [ProgressiveSource])

    Parameters

    progressiveSources

    The progressive sources for this source configuration.

    Return Value

    A new source item initialized with the given progressive sources.

  • Returns the stream URL for the given media source type. Possible parameter values are defined in BMPMediaSourceType.h.

    Declaration

    Objective-C

    - (nullable NSURL *)urlForType:(BMPMediaSourceType)type;

    Swift

    func url(forType type: BMPMediaSourceType) -> URL?

    Parameters

    type

    The media source type to get the URL for.

    Return Value

    The URL for the given media source type or nil if an invalid type was passed.

  • Returns the BMPDRMConfiguration for the given DRM scheme. Possible parameter values are defined in BMPDRMSystems.h.

    Declaration

    Objective-C

    - (nullable BMPDRMConfiguration *)drmConfigurationForDRMScheme:
        (nonnull NSUUID *)uuid;

    Swift

    func drmConfigurationForDRMScheme(uuid: UUID) -> DRMConfiguration?

    Parameters

    uuid

    The UUID of the corresponding DRM scheme.

    Return Value

    The BMPDRMConfiguration for the given UUID or nil if an invalid UUID was passed.

  • Adds a given BMPDRMConfiguration to this source item.

    Declaration

    Objective-C

    - (void)addDRMConfiguration:(nonnull BMPDRMConfiguration *)drmConfiguration;

    Swift

    func add(drmConfiguration: DRMConfiguration)

    Parameters

    drmConfiguration

    The BMPDRMConfiguration to add.

  • Indicates whether this source item contains a source for the given media source type. Possible parameter values are defined in BMPMediaSourceType.h.

    Declaration

    Objective-C

    - (BOOL)hasSourceOfType:(BMPMediaSourceType)type;

    Swift

    func hasSource(ofType type: BMPMediaSourceType) -> Bool

    Parameters

    type

    The media source type to check.

    Return Value

    YES if a source for the given type is set, NO otherwise.

  • Tries to a add a new media source for the given URL.

    Note

    If an invalid URL was passed or media source for the URL cannot be identified, this method will fail.

    Declaration

    Objective-C

    - (BOOL)addSource:(nonnull NSURL *)url
                error:(NSError *_Nullable *_Nullable)error;

    Swift

    func add(sourceUrl url: URL) throws

    Parameters

    url

    The URL of the media source to add.

    error

    A pointer to an error object for receiving information about any problems that occurred when adding the source.

    Return Value

    YES if the media source was added correctly, NO otherwise.

  • Tries to add a given adaptive source to this source item.

    Note

    If an adaptive source gets added and a source for the according type is already set, this method will fail. For example, adding a HLS source altough already set.

    Declaration

    Objective-C

    - (BOOL)addAdaptiveSource:(nonnull BMPAdaptiveSource *)adaptiveSource
                        error:(NSError *_Nullable *_Nullable)error;

    Swift

    func add(adaptiveSource: AdaptiveSource) throws

    Parameters

    adaptiveSource

    The adaptive source to add.

    error

    A pointer to an error object for receiving information about any problems that occurred when adding the source.

    Return Value

    YES if the adaptive source was added correctly, NO otherwise.

  • Tries to add a given progressive source to this source item.

    Note

    If an progressive source gets added and there are already progressive sources set, this method will fail. If you want to add multiple progressive source at a time, use #addProgressiveSources:error.

    Declaration

    Objective-C

    - (BOOL)addProgressiveSource:(nonnull BMPProgressiveSource *)progressiveSource
                           error:(NSError *_Nullable *_Nullable)error;

    Swift

    func add(progressiveSource: ProgressiveSource) throws

    Parameters

    progressiveSource

    The progressive source to add.

    error

    A pointer to an error object for receiving information about any problems that occurred when adding the source.

    Return Value

    YES if the progressive source was added correctly, NO otherwise.

  • Tries to add the given progressive sources to this source item.

    Note

    If progressive sources get added and there are already progressive sources set, this method will fail.

    Declaration

    Objective-C

    - (BOOL)addProgressiveSources:
                (nonnull NSArray<BMPProgressiveSource *> *)progressiveSources
                            error:(NSError *_Nullable *_Nullable)error;

    Swift

    func add(progressiveSources: [ProgressiveSource]) throws

    Parameters

    progressiveSources

    The progressive sources to add.

    error

    A pointer to an error object for receiving information about any problems that occurred when adding the sources.

    Return Value

    YES if the adaptive source was added correctly, NO otherwise.

  • Can be used to add external subtitles to this source item.

    Note

    Subtitles which are added using this method are only supported in combination with our Bitmovin UI or for source items which are loaded into a Chromecast session.

    Declaration

    Objective-C

    - (void)addSubtitleTrack:(nonnull BMPSubtitleTrack *)subtitleTrack;

    Swift

    func add(subtitleTrack: SubtitleTrack)

    Parameters

    subtitleTrack

    The subtitle track to add.