MillicastSDK 2.0.0
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) - audioTracksWithCompletionHandler:
 
(void) - videoTracksWithCompletionHandler:
 
(void) - addWebrtcRemoteTrackWithKind:cname:completionHandler:
 
(void) - webrtcAudioTracksWithCompletionHandler:
 
(void) - webrtcVideoTracksWithCompletionHandler:
 
(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:
 

Properties

id< MCSubscriberDelegatedelegate
 

Detailed Description

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

Method Documentation

◆ addWebrtcRemoteTrackWithKind:cname:completionHandler:

- (void) addWebrtcRemoteTrackWithKind: (MCRemoteTrackKind)  kind
cname: (NSString *_Nonnull)  cname
completionHandler: (addWebrtcRemoteTrack(kind:cname:completionHandler:))  NS_SWIFT_NAME 

Create a webrtc remote track that can be used for advanced projection use cases

  • Parameters:
    • kind: The kind of the track, either audio or video.
    • cname: RTCP CNAME. Allows to play different tracks with the same cname in a synchronized manner.
    • completionHandler: Invoked when the asynchronous operation completes, with a newly created webrtc remote track.

◆ audioTracksWithCompletionHandler:

- (void) audioTracksWithCompletionHandler: (nonnull void(^)(NSArray< MCRTSRemoteAudioTrack * > *_Nullable, NSError *_Nullable))  completionHandler

List all available rts remote audio tracks received so far.

  • Parameters:
    • completionHandler: Invoked when the asynchronous operation completes, with a list of remote audio tracks.

◆ getCredentialsWithCompletionHandler:

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

Get the current viewer's credentials.

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

◆ initWithDelegate:

- (instancetype) initWithDelegate: (id< MCSubscriberDelegate > _Nullable)  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.

◆ 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.

◆ 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.

◆ videoTracksWithCompletionHandler:

- (void) videoTracksWithCompletionHandler: (nonnull void(^)(NSArray< MCRTSRemoteVideoTrack * > *_Nullable, NSError *_Nullable))  completionHandler

List all available rts remote video tracks received so far.

  • Parameters:
    • completionHandler: Invoked when the asynchronous operation completes, with a list of remote video tracks.

◆ webrtcAudioTracksWithCompletionHandler:

- (void) webrtcAudioTracksWithCompletionHandler: (nonnull void(^)(NSArray< MCWebrtcRemoteAudioTrack * > *_Nullable, NSError *_Nullable))  completionHandler

List all available webrtc remote audio tracks created so far.

  • Parameters:
    • completionHandler: Invoked when the asynchronous operation completes, with a list of webrtc remote audio tracks.

◆ webrtcVideoTracksWithCompletionHandler:

- (void) webrtcVideoTracksWithCompletionHandler: (nonnull void(^)(NSArray< MCWebrtcRemoteAudioTrack * > *_Nullable, NSError *_Nullable))  completionHandler

List all available webrtc remote video tracks created so far.

  • Parameters:
    • completionHandler: Invoked when the asynchronous operation completes, with a list of webrtc remote video tracks.

Property Documentation

◆ delegate

- (id<MCSubscriberDelegate>) delegate
readwritenonatomicweak

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