MillicastSDK 2.0.0
Loading...
Searching...
No Matches
publisher.h
Go to the documentation of this file.
2#import <MillicastSDK/exports.h>
3
4// Forward declarations ///////////////////////////////////////////////////////
5NS_ASSUME_NONNULL_BEGIN
6
7@class MCVideoTrack;
8@class MCAudioTrack;
9@class MCTrack;
10@class MCPublisher;
11
12// Publisher //////////////////////////////////////////////////////////////////
13
19MILLICAST_API @protocol MCPublisherDelegate <MCDelegate>
20@optional
24- (void) publisherDidReceiveFirstViewerActive: (nonnull MCPublisher*) publisher;
25
26@optional
30- (void) publisherDidReceiveLastViewerInactive: (nonnull MCPublisher*) publisher;
31@end
32
33
38
40@property (nonatomic, strong) NSString* streamName;
41
43@property (nonatomic, strong) NSString* token;
44
46@property (nonatomic, strong) NSString* apiUrl;
47
48@end
49
51MILLICAST_API @interface MCPublisher : NSObject<MCClient>
52
53@property(nonatomic, weak) id<MCPublisherDelegate> delegate;
54
58- (instancetype) initWithDelegate: (nullable id<MCPublisherDelegate>) delegate;
59
67- (void) publishWithCompletionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
68
69
74- (void) publishWithOptions:(nonnull MCClientOptions *) options
75 completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
76
82- (void) unpublishWithCompletionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
83
88- (void) isPublishingWithCompletionHandler:(nonnull void (^)(BOOL publishing)) completionHandler;
89
95- (void) setCredentials:(nonnull MCPublisherCredentials*) credentials
96 completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
97
101- (void) getCredentialsWithCompletionHandler: (nonnull void (^)(MCPublisherCredentials * _Nonnull)) completionHandler;
102
108- (void) addTrackWithVideoTrack:(nonnull MCVideoTrack*) videoTrack
109 completionHandler:(nonnull void (^)(void)) completionHandler;
110
116- (void) addTrackWithAudioTrack:(nonnull MCAudioTrack*) audioTrack
117 completionHandler:(nonnull void (^)(void)) completionHandler;
118
122- (void) clearTracksWithCompletionHandler:(nonnull void (^)(void)) completionHandler;
123
128-(void) recordWithCompletionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
129
130
136-(void) unrecordWithCompletionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
137
138//-(void) setFrameMetadataHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
139
140@end
141
142NS_ASSUME_NONNULL_END
#define MILLICAST_API
Definition exports.h:51
Manages and plays a single audio resource.
Definition track.h:51
The MCClientOptions class gathers options for the client.
Definition client.h:209
Definition publisher.h:38
NSString * apiUrl
The publish API URL.
Definition publisher.h:46
NSString * streamName
The name of the stream to publish.
Definition publisher.h:40
NSString * token
The publishing token.
Definition publisher.h:43
The Publisher interface is responsible for publishing media to a Millicast stream.
Definition publisher.h:51
Represents a captured instance of a media source.
Definition track.h:10
Responsible for managing video capture session from a video source.
Definition track.h:33
The Client base that contains common methods between MCPublisher and MCSubscriber.
Definition client.h:297