Skip to content

Commit

Permalink
room & doc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maross committed Jan 18, 2016
1 parent b1cb7d5 commit 52573da
Show file tree
Hide file tree
Showing 38 changed files with 254 additions and 602 deletions.
2 changes: 1 addition & 1 deletion Classes/Room/NBMRoom.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ typedef NS_ENUM(NSInteger, NBMRoomErrorCode) {
- (instancetype)initWithUsername:(NSString *)username roomName:(NSString *)name roomURL:(NSURL *)url;

@property (nonatomic, copy, readonly) NSString *name;
@property (nonatomic, strong) NSURL *url;
@property (nonatomic, strong, readonly) NSURL *url;
@property (nonatomic, copy, readonly) NBMPeer *localPeer;
@property (nonatomic, strong, readonly) NSSet *peers;

Expand Down
7 changes: 4 additions & 3 deletions Classes/Room/NBMRoomClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ typedef NS_ENUM(NSInteger, NBMRoomClientErrorCode) {
@interface NBMRoomClient : NSObject

@property (nonatomic, weak) id<NBMRoomClientDelegate> delegate;
@property (nonatomic, readonly) NSDictionary *peers;
@property (nonatomic, readonly) NSSet *peers;
@property (nonatomic, readonly) NBMRoom *room;
@property (nonatomic, assign, readonly) NSTimeInterval timeout;
@property (nonatomic, assign, readonly, getter = isConnected) BOOL connected;
@property (nonatomic, assign, readonly, getter = isJoined) BOOL joined;
Expand Down Expand Up @@ -65,8 +66,8 @@ typedef NS_ENUM(NSInteger, NBMRoomClientErrorCode) {
- (void)unsubscribeVideoFromPeer:(NBMPeer *)peer;
- (void)unsubscribeVideoFromPeer:(NBMPeer *)peer completion:(void (^)(NSString *sdpAnswer, NSError *error))block;

- (void)sendICECandidate:(RTCICECandidate *)candidate;
- (void)sendICECandidate:(RTCICECandidate *)candidate completion:(void (^)(NSError *error))block;
- (void)sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer;
- (void)sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer completion:(void (^)(NSError *error))block;

- (void)sendMessage:(NSString *)message;
- (void)sendMessage:(NSString *)message completion:(void (^)(NSError *error))block;
Expand Down
29 changes: 18 additions & 11 deletions Classes/Room/NBMRoomClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ @interface NBMRoomClient () <NBMJSONRPCClientDelegate>
@property (nonatomic, assign) BOOL closeRequested;
@property (nonatomic, strong) NSError *rpcError;

@property (nonatomic, strong) NBMRoom *room;
@property (nonatomic, strong, readwrite) NBMRoom *room;
@property (nonatomic, strong) NSMutableDictionary *mutableRoomPeers;
@property (nonatomic, assign) BOOL joined;
//@property (nonatomic, assign) BOOL joinRoomRequested;
Expand Down Expand Up @@ -180,6 +180,12 @@ - (void)connect {
}
}

#pragma mark - Properties

- (NBMRoom *)room {
return self.room;
}

#pragma mark Join room

- (void)joinRoom:(JoinRoomBlock)completionBlock {
Expand Down Expand Up @@ -268,16 +274,16 @@ - (void)unsubscribeVideoFromPeer:(NBMPeer *)peer completion:(void (^)(NSString *

#pragma mark Send ICE candidate

- (void)sendICECandidate:(RTCICECandidate *)candidate {
return [self sendICECandidate:candidate completion:^(NSError *error) {
if ([self.delegate respondsToSelector:@selector(client:didSentICECandidate:)]) {
[self.delegate client:self didSentICECandidate:error];
- (void)sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer {
return [self sendICECandidate:candidate forPeer:peer completion:^(NSError *error) {
if ([self.delegate respondsToSelector:@selector(client:didSentICECandidate:forPeer:)]) {
[self.delegate client:self didSentICECandidate:error forPeer:peer];
}
}];
}

- (void)sendICECandidate:(RTCICECandidate *)candidate completion:(void (^)(NSError *))block {
[self nbm_sendICECandidate:candidate completion:block];
- (void)sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer completion:(void (^)(NSError *))block {
[self nbm_sendICECandidate:candidate forPeer:peer completion:block];
}

#pragma mark Send message
Expand Down Expand Up @@ -499,8 +505,8 @@ - (void)nbm_unsubscribeVideoFormPeer:(NBMPeer *)peer completion:(void (^)(NSStri

#pragma mark Send ICE candidate

- (void)nbm_sendICECandidate:(RTCICECandidate *)candidate completion:(void (^)(NSError *error))block {
NSDictionary *params = @{kOnIceCandidateEpnameParam: self.room.localPeer.identifier,
- (void)nbm_sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer completion:(void (^)(NSError *error))block {
NSDictionary *params = @{kOnIceCandidateEpnameParam: peer.identifier,
kOnIceCandidateCandidateParam: candidate.sdp ?: @"",
kOnIceCandidateSdpMidParam: candidate.sdpMid ?: @"",
kOnIceCandidateSdpMLineIndexParam: @(candidate.sdpMLineIndex)};
Expand Down Expand Up @@ -556,8 +562,9 @@ - (NBMPeer *)peerWithIdentifier:(NSString *)identifier {
return peer;
}

- (NSDictionary *)peers {
return [self.mutableRoomPeers copy];
- (NSSet *)peers {
NSArray *allPeers = [self.mutableRoomPeers allValues];
return [NSSet setWithArray:allPeers];
}

#pragma mark Room events
Expand Down
2 changes: 1 addition & 1 deletion Classes/Room/NBMRoomClientDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
- (void)client:(NBMRoomClient *)client didReceiveVideoFrom:(NBMPeer *)peer sdpAnswer:(NSString *)sdpAnswer error:(NSError *)error;
- (void)client:(NBMRoomClient *)client didUnsubscribeVideoFrom:(NBMPeer *)peer sdpAnswer:(NSString *)sdpAnswer error:(NSError *)error;

- (void)client:(NBMRoomClient *)client didSentICECandidate:(NSError *)error;
- (void)client:(NBMRoomClient *)client didSentICECandidate:(NSError *)error forPeer:(NBMPeer *)peer;

- (void)client:(NBMRoomClient *)client didSentMessage:(NSError *)error;

Expand Down
9 changes: 7 additions & 2 deletions KurentoToolboxTestApp/KurentoToolboxTestApp/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ @implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NBMRoom *roomm = [[NBMRoom alloc] initWithUsername:@"maross" roomName:@"mr5" roomURL:[NSURL URLWithString:@"http://kurento.teamlife.it:8080/room"]];
self.roomClient = [[NBMRoomClient alloc] initWithRoom:roomm timeout:10 delegate:self];
NBMMediaConfiguration *mediaConfig = [NBMMediaConfiguration defaultConfiguration];
NBMWebRTCPeer *web = [[NBMWebRTCPeer alloc] initWithDelegate:self configuration:nil];
NBMRoom *room = [[NBMRoom alloc] initWithUsername:@"maross" roomName:@"mr5" roomURL:[NSURL URLWithString:@"http://kurento.teamlife.it:8080/room"]];
self.roomClient = [[NBMRoomClient alloc] initWithRoom:room timeout:10 delegate:self];
[self enableButtons:NO];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.roomClient joinRoom:^(NSDictionary *peers, NSError *error) {

}];
// if (self.roomClient.connected) {
// for (int i = 0; i<5; i++) {
// [self.roomClient joinRoom];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">

<title>NBMError Class Reference</title>
<title>NBMEAGLRenderer Class Reference</title>

<link rel="stylesheet" href="../css/style.css">
<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
Expand Down Expand Up @@ -52,25 +52,27 @@ <h1 id="library-title">





<optgroup label="Class Methods">
<optgroup label="Properties">
<option value="//api/name/delegate">delegate</option>

<option value="//api/name/errorDomain">+ errorDomain</option>
<option value="//api/name/hasVideoData">hasVideoData</option>

<option value="//api/name/errorWithCode:message:">+ errorWithCode:message:</option>
<option value="//api/name/rendererView">rendererView</option>

<option value="//api/name/errorWithCode:message:underlyingError:">+ errorWithCode:message:underlyingError:</option>
<option value="//api/name/videoSize">videoSize</option>

<option value="//api/name/errorWithCode:message:userInfo:underlyingError:">+ errorWithCode:message:userInfo:underlyingError:</option>
<option value="//api/name/videoTrack">videoTrack</option>

</optgroup>





<optgroup label="Instance Methods">

<option value="//api/name/init">- init</option>
<option value="//api/name/initWithDelegate:">- initWithDelegate:</option>

</optgroup>

Expand All @@ -87,16 +89,19 @@ <h1 id="library-title">
<div id="overview_contents" class="container">
<div id="content">
<main role="main">
<h1 class="title">NBMError Class Reference</h1>
<h1 class="title">NBMEAGLRenderer Class Reference</h1>


<div class="section section-specification"><table cellspacing="0"><tbody>
<tr>
<th>Inherits from</th>
<td>NSObject</td>
</tr><tr>
<th>Conforms to</th>
<td><a href="../Protocols/NBMRenderer.html">NBMRenderer</a></td>
</tr><tr>
<th>Declared in</th>
<td>NBMError.h</td>
<td>NBMEAGLRenderer.h</td>
</tr>
</tbody></table></div>

Expand All @@ -114,8 +119,24 @@ <h1 class="title">NBMError Class Reference</h1>

<div class="task-list">
<div class="section-method">
<a name="//api/name/errorDomain" title="errorDomain"></a>
<h3 class="method-title"><code><a href="#//api/name/errorDomain">+&nbsp;errorDomain</a></code>
<a name="//api/name/initWithDelegate:" title="initWithDelegate:"></a>
<h3 class="method-title"><code><a href="#//api/name/initWithDelegate:">&ndash;&nbsp;initWithDelegate:</a></code>
</h3>

<div class="method-info">
<div class="pointy-thing"></div>

<div class="method-info-container">


<div class="method-subsection method-declaration"><code>- (instancetype)initWithDelegate:(id&lt;NBMRendererDelegate&gt;)<em>delegate</em></code></div>


</div>
</div>
</div><div class="section-method">
<a name="//api/name/delegate" title="delegate"></a>
<h3 class="method-title"><code><a href="#//api/name/delegate">&nbsp;&nbsp;delegate</a></code>
</h3>

<div class="method-info">
Expand All @@ -124,14 +145,14 @@ <h3 class="method-title"><code><a href="#//api/name/errorDomain">+&nbsp;errorDom
<div class="method-info-container">


<div class="method-subsection method-declaration"><code>+ (NSString *)errorDomain</code></div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, weak) id&lt;NBMRendererDelegate&gt; delegate</code></div>


</div>
</div>
</div><div class="section-method">
<a name="//api/name/errorWithCode:message:" title="errorWithCode:message:"></a>
<h3 class="method-title"><code><a href="#//api/name/errorWithCode:message:">+&nbsp;errorWithCode:message:</a></code>
<a name="//api/name/videoTrack" title="videoTrack"></a>
<h3 class="method-title"><code><a href="#//api/name/videoTrack">&nbsp;&nbsp;videoTrack</a></code>
</h3>

<div class="method-info">
Expand All @@ -140,14 +161,14 @@ <h3 class="method-title"><code><a href="#//api/name/errorWithCode:message:">+&nb
<div class="method-info-container">


<div class="method-subsection method-declaration"><code>+ (NSError *)errorWithCode:(NSInteger)<em>code</em> message:(NSString *)<em>message</em></code></div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, strong) RTCVideoTrack *videoTrack</code></div>


</div>
</div>
</div><div class="section-method">
<a name="//api/name/errorWithCode:message:underlyingError:" title="errorWithCode:message:underlyingError:"></a>
<h3 class="method-title"><code><a href="#//api/name/errorWithCode:message:underlyingError:">+&nbsp;errorWithCode:message:underlyingError:</a></code>
<a name="//api/name/videoSize" title="videoSize"></a>
<h3 class="method-title"><code><a href="#//api/name/videoSize">&nbsp;&nbsp;videoSize</a></code>
</h3>

<div class="method-info">
Expand All @@ -156,14 +177,14 @@ <h3 class="method-title"><code><a href="#//api/name/errorWithCode:message:underl
<div class="method-info-container">


<div class="method-subsection method-declaration"><code>+ (NSError *)errorWithCode:(NSInteger)<em>code</em> message:(NSString *)<em>message</em> underlyingError:(NSError *)<em>underlyingError</em></code></div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) CGSize videoSize</code></div>


</div>
</div>
</div><div class="section-method">
<a name="//api/name/errorWithCode:message:userInfo:underlyingError:" title="errorWithCode:message:userInfo:underlyingError:"></a>
<h3 class="method-title"><code><a href="#//api/name/errorWithCode:message:userInfo:underlyingError:">+&nbsp;errorWithCode:message:userInfo:underlyingError:</a></code>
<a name="//api/name/rendererView" title="rendererView"></a>
<h3 class="method-title"><code><a href="#//api/name/rendererView">&nbsp;&nbsp;rendererView</a></code>
</h3>

<div class="method-info">
Expand All @@ -172,14 +193,14 @@ <h3 class="method-title"><code><a href="#//api/name/errorWithCode:message:userIn
<div class="method-info-container">


<div class="method-subsection method-declaration"><code>+ (NSError *)errorWithCode:(NSInteger)<em>code</em> message:(NSString *)<em>message</em> userInfo:(NSDictionary *)<em>userInfo</em> underlyingError:(NSError *)<em>underlyingError</em></code></div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, strong, readonly) UIView *rendererView</code></div>


</div>
</div>
</div><div class="section-method">
<a name="//api/name/init" title="init"></a>
<h3 class="method-title"><code><a href="#//api/name/init">&ndash;&nbsp;init</a></code>
<a name="//api/name/hasVideoData" title="hasVideoData"></a>
<h3 class="method-title"><code><a href="#//api/name/hasVideoData">&nbsp;&nbsp;hasVideoData</a></code>
</h3>

<div class="method-info">
Expand All @@ -188,7 +209,7 @@ <h3 class="method-title"><code><a href="#//api/name/init">&ndash;&nbsp;init</a><
<div class="method-info-container">


<div class="method-subsection method-declaration"><code>- (id)init</code></div>
<div class="method-subsection method-declaration"><code>@property (atomic, assign, readonly) BOOL hasVideoData</code></div>


</div>
Expand All @@ -208,7 +229,7 @@ <h3 class="method-title"><code><a href="#//api/name/init">&ndash;&nbsp;init</a><
<footer>
<div class="footer-copyright">

<p class="copyright">Copyright &copy; 2016 Nubomedia TI. All rights reserved. Updated: 2016-01-08</p>
<p class="copyright">Copyright &copy; 2016 Nubomedia TI. All rights reserved. Updated: 2016-01-15</p>


<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
Expand Down
Loading

0 comments on commit 52573da

Please sign in to comment.