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

The Publisher interface is responsible for publishing media to a Millicast stream. More...

#import <publisher.h>

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

Instance Methods

(instancetype) - initWithDelegate:
 
(void) - publishWithCompletionHandler:
 
(void) - publishWithOptions:completionHandler:
 
(void) - unpublishWithCompletionHandler:
 
(void) - isPublishingWithCompletionHandler:
 
(void) - setCredentials:completionHandler:
 
(void) - getCredentialsWithCompletionHandler:
 
(void) - addTrackWithVideoTrack:completionHandler:
 
(void) - addTrackWithAudioTrack:completionHandler:
 
(void) - clearTracksWithCompletionHandler:
 
(void) - recordWithCompletionHandler:
 
(void) - unrecordWithCompletionHandler:
 
- 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< MCPublisherDelegatedelegate
 

Detailed Description

The Publisher interface is responsible for publishing media to a Millicast stream.

Method Documentation

◆ addTrackWithAudioTrack:completionHandler:

- (void) addTrackWithAudioTrack: (nonnull MCAudioTrack *)  audioTrack
completionHandler: (nonnull void(^)(void))  completionHandler 

Adds an audio track to the publisher. See MCAudioSource/startCapture as an example for capturing an audio device track.

  • Parameters:
    • videoTrack: The video track to add.
    • completionHandler: Invoked when the result is ready.

◆ addTrackWithVideoTrack:completionHandler:

- (void) addTrackWithVideoTrack: (nonnull MCVideoTrack *)  videoTrack
completionHandler: (nonnull void(^)(void))  completionHandler 

Adds a video track to the publisher. See MCVideoSource/startCapture as an example for capturing a video device track.

  • Parameters:
    • videoTrack: The video track to add.
    • completionHandler: Invoked when the result is ready.

◆ clearTracksWithCompletionHandler:

- (void) clearTracksWithCompletionHandler: (nonnull void(^)(void))  completionHandler

Clears all tracks added to the publisher.

  • Parameters:
    • completionHandler: Invoked when the result is ready.

◆ getCredentialsWithCompletionHandler:

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

Returns the current publisher credentials.

  • Parameters:
    • completionHandler: Invoked when the result is ready.

◆ initWithDelegate:

- (instancetype) initWithDelegate: (nullable id< MCPublisherDelegate >)  delegate

Initializes a publisher.

  • Parameters:
    • delegate: The publisher delegate to receive events related to publishing

◆ isPublishingWithCompletionHandler:

- (void) isPublishingWithCompletionHandler: (nonnull void(^)(BOOL publishing))  completionHandler

Checks whether the publisher is currently in a publishing state and returns a boolean indicating the publishing status.

  • Parameters:
    • completionHandler: Invoked when the result is ready.

◆ publishWithCompletionHandler:

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

Initiates the process of publishing streams to the streaming platform. Prior to calling this method, you must use the MCClient/connectWithCompletionHandler:or MCClient/connectWithWebsocketUrl:jwt:completionHandler: method to connect the publisher to the platform. When publishing, the SDK sets the AVAudioSession to the playAndRecord category, with voiceChat mode and allowBluetooth option. If desired, the application can configure the AVAudioSession with its own settings.

  • Parameters:
    • completionHandler: Invoked when the result is ready.

◆ publishWithOptions:completionHandler:

- (void) publishWithOptions: (nonnull MCClientOptions *)  options
completionHandler: (nonnull void(^)(NSError *_Nullable))  completionHandler 

Publish a stream with configuration options.

  • Parameters:
    • options: Options to configure the publishing session. For example, audio/video codec selection.
    • completionHandler: Invoked when the result is ready.

◆ recordWithCompletionHandler:

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

Starts recording a stream. See the Recording Docs for more information.

  • Parameters:
    • completionHandler: completionHandler Invoked when result is ready.

◆ setCredentials:completionHandler:

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

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

  • Parameters:
    • credentials: The publishing credentials.
    • completionHandler: Invoked when the result is ready.

◆ unpublishWithCompletionHandler:

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

Stops the process of publishing streams to the streaming platform. After calling this method, the SDK automatically terminates the connection between the publisher and the streaming platform.

  • Parameters:
    • completionHandler: Invoked when the result is ready.

◆ unrecordWithCompletionHandler:

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

Stops recording a stream. See the Recording Docs for more information on how to access the recordings.

  • Parameters:
    • completionHandler: completionHandler Invoked when result is ready.

Property Documentation

◆ delegate

- (id<MCPublisherDelegate>) delegate
readwritenonatomicweak

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