MillicastSDK 1.8.4
Loading...
Searching...
No Matches
Instance Methods | Properties | List of all members
MCSubscriber Class Reference

The Subscriber class manages the subscription to audio and video tracks from the Millicast platform. More...

#import <viewer.h>

Inheritance diagram for MCSubscriber:
Inheritance graph
[legend]
Collaboration diagram for MCSubscriber:
Collaboration graph
[legend]

Instance Methods

(instancetype) - initWithDelegate:
 
(void) - subscribeWithCompletionHandler:
 
(void) - subscribeWithOptions:completionHandler:
 
(void) - isSubscribedWithCompletionHandler:
 
(void) - unsubscribeWithCompletionHandler:
 
(void) - project:withData:completionHandler:
 
(void) - unproject:completionHandler:
 
(void) - select:completionHandler:
 
(void) - addRemoteTrack:completionHandler:
 
(void) - getMid:completionHandler:
 
(void) - setCredentials:completionHandler:
 
(void) - getCredentialsWithCompletionHandler:
 
- Instance Methods inherited from <MCClient>
(void) - connectWithCompletionHandler:
 
(void) - connectWithOptions:completionHandler:
 
(void) - connectWithWebsocketUrl:jwt:completionHandler:
 
(void) - connectWithWebsocketUrl:jwt:connectionOptions:completionHandler:
 
(void) - isConnectedWithCompletionHandler:
 
(void) - disconnectWithCompletionHandler:
 
(void) - enableStats:completionHandler:
 
(void) - enableFrameTransformer:completionHandler:
 
(void) - getMid:completionHandler:
 

Properties

id< MCSubscriberDelegatedelegate
 

Detailed Description

The Subscriber class manages the subscription to audio and video tracks from the Millicast platform.

Method Documentation

◆ addRemoteTrack:completionHandler:

- (void) addRemoteTrack: (NSString *)  kind
completionHandler: (nonnull void(^)(NSError *_Nullable))  completionHandler 

Dynamically add on new track to the subscriber so you can project another source into it. It will locally renegociate the SDP.

  • Parameters:
    • kind: The kind of the track. "video" or "audio"
    • completionHandler: handler invoked when the result is ready.

◆ getCredentialsWithCompletionHandler:

- (void) getCredentialsWithCompletionHandler: (nonnull void(^)(MCSubscriberCredentials *_Nonnull))  completionHandler

Get the current viewer's credentials.

  • Parameters:
    • completionHandler Handler invoked when the result is ready.

◆ getMid:completionHandler:

- (void) getMid: (NSString *)  trackId
completionHandler: (nonnull void(^)(NSString *, NSError *_Nullable))  completionHandler 

Get the transceiver mid associated to a track.

  • Parameters:
    • trackId: The id of the track we want to retrieve the mid
    • completionHandler: handler invoked when the result is ready.

◆ initWithDelegate:

- (instancetype) initWithDelegate: (id< MCSubscriberDelegate >)  delegate

Initialize a subscriber.

  • Parameters:
    • delegate The subscriber delegate to receive events related to subscribing.
  • Returns: A subscriber object.

◆ isSubscribedWithCompletionHandler:

- (void) isSubscribedWithCompletionHandler: (nonnull void(^)(BOOL subscribed))  completionHandler

Checks whether the subscriber is currently subscribing to any media.

  • Parameters:
    • completionHandler: Handler invoked when the result is ready.

◆ project:withData:completionHandler:

- (void) project: (NSString *)  sourceId
withData: (NSArray< MCProjectionData * > *)  projectionData
completionHandler: (nonnull void(^)(NSError *_Nullable))  completionHandler 

Specify the source you want to receive. With the project method you can select and switch sources from the Millicast server and then forward the selected media to the subscriber, for each audio and video track.

  • Parameters:
    • sourceId: The source id you want to receive
    • projectionData: The configuration of the track you want to receive.
    • completionHandler: Handler invoked when the result is ready.

◆ select:completionHandler:

- (void) select: (MCLayerData *_Nullable)  layer
completionHandler: (nonnull void(^)(NSError *_Nullable))  completionHandler 

Select a specific simulcast/SVC layer for a video track.

  • Parameters:
    • layer: The data to select which layer and which track. Send an empty optional to reset to automatic layer selection by the server.
    • completionHandler: Handler invoked when the result is ready.

◆ setCredentials:completionHandler:

- (void) setCredentials: (nonnull MCSubscriberCredentials *)  credentials
completionHandler: (nonnull void(^)(NSError *_Nullable))  completionHandler 

Sets the credentials, providing authentication information required for connecting to the streaming platform.

  • Parameters:
    • credentials: The credentials.
    • completionHandler: Handler invoked when the result is ready.

◆ subscribeWithCompletionHandler:

- (void) subscribeWithCompletionHandler: (nonnull void(^)(NSError *_Nullable))  completionHandler

Initiates the subscription process from the Millicast platform. Prior to calling this method, you must use the MCClient/connectWithCompletionHandler: or similar to connect the subscriber to the platform. Successful subscription results in calling the onSubscribed method of the Listener.

  • Parameters:
    • completionHandler: Handler invoked when the result is ready.

◆ subscribeWithOptions:completionHandler:

- (void) subscribeWithOptions: (MCClientOptions *)  opts
completionHandler: (nonnull void(^)(NSError *_Nullable))  completionHandler 

Subscribes to a stream with options.

  • Parameters:
    • opts: Options to be applied for subscribing. Only valid subscriber options in MCClientOptions will be used; others will be ignored.
    • completionHandler: Handler invoked when the result is ready.

◆ unproject:completionHandler:

- (void) unproject: (NSArray< NSString * > *)  mids
completionHandler: (nonnull void(^)(NSError *_Nullable))  completionHandler 

Specify the media you want to stop receving.

  • Parameters:
    • mids: The list of mids to unproject.
    • completionHandler: Handler invoked when the result is ready.

◆ unsubscribeWithCompletionHandler:

- (void) unsubscribeWithCompletionHandler: (nonnull void(^)(NSError *_Nullable))  completionHandler

Stops the subscription process indicating to the streaming server that the subscriber is no longer interested in receiving audio and video content. After calling this method, the SDK automatically terminates the connection between the subscriber and the streaming platform.

  • Parameters:
    • completionHandler: Handler invoked when the result is ready.

Property Documentation

◆ delegate

- (id<MCSubscriberDelegate>) delegate
readwritenonatomicweak

The documentation for this class was generated from the following file: