Intel® Collaboration Suite for WebRTC  version 4.3.1
Open WebRTC Toolkit (OWT) Client SDK for iOS*
OWTP2PClient.h
1 // Copyright (C) <2018> Intel Corporation
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 #import <Foundation/Foundation.h>
5 #import <WebRTC/RTCMacros.h>
6 #import <WebRTC/RTCLegacyStatsReport.h>
7 #import "OWT/OWTLocalStream.h"
8 #import "OWT/OWTP2PClientConfiguration.h"
9 #import "OWT/OWTP2PPeerConnectionChannelObserver.h"
10 #import "OWT/OWTP2PSignalingChannelProtocol.h"
11 #import "OWT/OWTP2PSignalingSenderProtocol.h"
12 NS_ASSUME_NONNULL_BEGIN
13 @protocol OWTP2PClientDelegate;
14 @class OWTP2PPublication;
16 RTC_OBJC_EXPORT
17 @interface OWTP2PClient : NSObject<OWTP2PPeerConnectionChannelObserver,
18  OWTP2PSignalingSenderProtocol,
25 - (instancetype)initWithConfiguration:(OWTP2PClientConfiguration*)configuration
26  signalingChannel:
27  (id<OWTP2PSignalingChannelProtocol>)signalingChannel;
38 - (void)connect:(NSString*)token
39  onSuccess:(nullable void (^)(NSString*))onSuccess
40  onFailure:(nullable void (^)(NSError*))onFailure;
50 - (void)disconnectWithOnSuccess:(nullable void (^)())onSuccess
51  onFailure:(nullable void (^)(NSError*))onFailure;
64 - (void)send:(NSString*)message
65  to:(NSString*)targetId
66  onSuccess:(nullable void (^)())onSuccess
67  onFailure:(nullable void (^)(NSError*))onFailure;
73 - (void)stop:(NSString*)targetId;
85 - (void)publish:(OWTLocalStream*)stream
86  to:(NSString*)targetId
87  onSuccess:(nullable void (^)(OWTP2PPublication*))onSuccess
88  onFailure:(nullable void (^)(NSError*))onFailure;
99 - (void)statsFor:(NSString*)targetId
100  onSuccess:(void (^)(NSArray<RTCLegacyStatsReport*>*))onSuccess
101  onFailure:(nullable void (^)(NSError*))onFailure;
102 @property(nonatomic, weak) id<OWTP2PClientDelegate> delegate;
103 @property(nonatomic, strong) NSMutableArray<NSString*>* allowedRemoteIds;
104 @end
106 RTC_OBJC_EXPORT
107 @protocol OWTP2PClientDelegate<NSObject>
108 @optional
112 - (void)p2pClientDidDisconnect:(OWTP2PClient*)client;
117 - (void)p2pClient:(OWTP2PClient*)client didAddStream:(OWTRemoteStream*)stream;
123 - (void)p2pClient:(OWTP2PClient*)client
124  didReceiveMessage:(NSString*)message
125  from:(NSString*)senderId;
126 @end
127 NS_ASSUME_NONNULL_END
Publication represents a sender for publishing a stream.
Definition: OWTP2PPublication.h:19
Configuration for OWTP2PClient This configuration is used while creating OWTP2PClient. Changing this configuration does NOT impact existing OWTP2PClients.
Definition: OWTP2PClientConfiguration.h:13
Protocol for signaling channel. Developers may utilize their own signaling server by implementing thi...
Definition: OWTP2PSignalingChannelProtocol.h:13
Signaling channel will notify observer when event triggers.
Definition: OWTP2PSignalingChannelProtocol.h:41
Delegate for OWTConferenceClient.
Definition: OWTP2PClient.h:107
This class represent a local stream.
Definition: OWTLocalStream.h:10
An async client for P2P WebRTC sessions.
Definition: OWTP2PClient.h:17
This class represents a remote stream.
Definition: OWTRemoteStream.h:10