now goes back to main frame when connection is terminated

This commit is contained in:
Diego Waxemberg
2014-10-21 01:02:04 -04:00
parent 127c53e341
commit a359aee36c
8 changed files with 71 additions and 46 deletions

View File

@@ -10,17 +10,18 @@
#import "CryptoManager.h"
#import "HttpManager.h"
#import "Utils.h"
#import "Connection.h"
@implementation StreamManager {
StreamConfiguration* _config;
UIView* _renderView;
id<ConTermCallback> _callback;
}
- (id) initWithConfig:(StreamConfiguration*)config renderView:(UIView*)view {
- (id) initWithConfig:(StreamConfiguration*)config renderView:(UIView*)view connectionTerminatedCallback:(id<ConTermCallback>)callback {
self = [super init];
_config = config;
_renderView = view;
_callback = callback;
_config.riKey = [Utils randomBytes:16];
_config.riKeyId = arc4random();
_config.bitRate = 10000;
@@ -48,8 +49,7 @@
}
VideoDecoderRenderer* renderer = [[VideoDecoderRenderer alloc]initWithView:_renderView];
Connection* conn = [[Connection alloc] initWithConfig:_config renderer:renderer];
Connection* conn = [[Connection alloc] initWithConfig:_config renderer:renderer connectionTerminatedCallback:_callback];
NSOperationQueue* opQueue = [[NSOperationQueue alloc] init];
[opQueue addOperation:conn];
}