NBMTreeClient Class Reference
Inherits from | NSObject |
---|---|
Declared in | NBMTreeClient.h |
Overview
The developer of Kurento Tree applications can use this client when implementing the front-end part of a broadcasting application with Kurento Tree. It’s actually only a wrapper over the JSON-RPC protocol used to communicate with Tree Server.
delegate
The delegate object for the client.
@property (nonatomic, weak, readonly) id<NBMTreeClientDelegate> delegate
Declared In
NBMTreeClient.h
treeEndpoints
A list of connected NBMTreeEndpoint objects.
@property (nonatomic, readonly) NSSet *treeEndpoints
Declared In
NBMTreeClient.h
timeout
The timeout interval for API requests, in seconds. Default value is 5.
@property (nonatomic, assign, readonly) NSTimeInterval timeout
Declared In
NBMTreeClient.h
connected
A Boolean that indicates the WebSocket connection status.
@property (nonatomic, assign, readonly, getter=isConnected) BOOL connected
Declared In
NBMTreeClient.h
treeId
The identifier of current tree.
@property (nonatomic, copy, readonly) NSString *treeId
Declared In
NBMTreeClient.h
– initWithURL:delegate:
- Creates and initializes a NBMTreeClient instance. *
- @param wsURL The url of Tree server.
- @param delegate The delegate object for the client.
- (instancetype)initWithURL:(NSURL *)wsURL delegate:(id<NBMTreeClientDelegate>)delegate
Discussion
- @return An initialized NBMTreeClient object.
Declared In
NBMTreeClient.h
– connect:
Connects client to the Tree Server using WebSocket, giving access to its API when the connection is established successfully.
- (void)connect:(NSTimeInterval)timeout
Parameters
timeout |
The timeout interval for API requests, in seconds. |
---|
Discussion
Note: See [NBMTreeClientDelegate client:isConnected:] method.
Declared In
NBMTreeClient.h
– createTree:completion:
Request to create a new tree in Tree server.
- (void)createTree:(NSString *)treeId completion:(void ( ^ ) ( NSError *error ))block
Parameters
treeId |
The tree identifier. May be nil. |
---|---|
block |
A block object to be executed when the request is processed. This block has no return value and takes an error if the request failed. |
Declared In
NBMTreeClient.h
– releaseTree:completion:
Request used to remove a tree.
- (void)releaseTree:(NSString *)treeId completion:(void ( ^ ) ( NSError *error ))block
Parameters
treeId |
Tree id to be removed |
---|---|
block |
A block object to be executed when the request is processed. This block has no return value and takes an error if the request failed. |
Declared In
NBMTreeClient.h
– setSource:tree:completion:
Request to configure the emitter (source) in a broadcast session (tree).
- (void)setSource:(NSString *)sdpOffer tree:(NSString *)treeId completion:(void ( ^ ) ( NSString *sdpAnswer , NSError *error ))block
Parameters
sdpOffer |
A NSString representing an SDP offer. |
---|---|
treeId |
Tree id to configure the source. |
block |
A block object to be executed when the request is processed. This block has no return value and takes an error if the request failed. |
Declared In
NBMTreeClient.h
– removeSourceOfTree:completion:
Request to remove the current emitter of a tree.
- (void)removeSourceOfTree:(NSString *)treeId completion:(void ( ^ ) ( NSError *error ))block
Parameters
treeId |
Tree id to remove the source. |
---|---|
block |
A block object to be executed when the request is processed. This block has no return value and takes an error if the request failed. |
Declared In
NBMTreeClient.h
– addSink:tree:completion:
Request to add a new viewer (sink) to the tree.
- (void)addSink:(NSString *)sdpOffer tree:(NSString *)treeId completion:(void ( ^ ) ( NBMTreeEndpoint *endpoint , NSError *error ))block
Parameters
sdpOffer |
A NSString representing an SDP offer. |
---|---|
treeId |
Tree id to add new viewer. |
block |
A block object to be executed when the request is processed. This block has no return value and takes an error if the request failed. |
Declared In
NBMTreeClient.h
– removeSink:tree:completion:
Request to remove a previously connected sink (viewer).
- (void)removeSink:(NSString *)sinkId tree:(NSString *)treeId completion:(void ( ^ ) ( NSError *error ))block
Parameters
sinkId |
Sink id to be removed. |
---|---|
treeId |
Tree id to remove the sink. |
block |
A block object to be executed when the request is processed. This block has no return value and takes an error if the request failed. |
Declared In
NBMTreeClient.h
– addICECandidate:forSink:tree:completion:
Request used to add a new ICE candidate gathered on the client side. This information is required to implement the trickle ICE mechanism.
- (void)addICECandidate:(RTCICECandidate *)candidate forSink:(NSString *)sinkId tree:(NSString *)treeId completion:(void ( ^ ) ( NSError *error ))block
Parameters
candidate |
The RTCICECandidate object to send. |
---|---|
sinkId |
Sink id to wich belongs the candidate, ‘nil’ if the candidate is referred to the tree source. |
treeId |
Tree id to which belongs this candidate. |
block |
A block object to be executed when the request is processed. This block has no return value and takes an error if the request failed. |
Declared In
NBMTreeClient.h