Last active
October 12, 2015 09:23
-
-
Save jeanlescure/2cdee9732036ea34b6a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface ViewController () | |
<OTSessionDelegate, OTSubscriberKitDelegate, OTPublisherDelegate> | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// OpentokRTC | |
// ... | |
#import <OpenTok/OpenTok.h> | |
// ... | |
@interface ViewController () | |
<OTSessionDelegate, OTSubscriberKitDelegate, OTPublisherDelegate> | |
@end | |
@implementation ViewController { | |
OTSession* _session; | |
OTPublisher* _publisher; | |
OTSubscriber* _subscriber; | |
id<OTVideoCapture> _cameraCapture; | |
// ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)sessionDidConnect:(OTSession*)session | |
{ | |
NSLog(@"sessionDidConnect (%@)", session.sessionId); | |
//Change the text of the status label | |
StatusLabel.text = [self getSessionStatus]; | |
//Change the status label color | |
[self changeStatusLabelColor]; | |
// Step 2: We have successfully connected, now instantiate a publisher and | |
// begin pushing A/V streams into OpenTok. | |
[self doPublish]; | |
} | |
- (void)sessionDidDisconnect:(OTSession*)session | |
{ | |
NSString* alertMessage = | |
[NSString stringWithFormat:@"Session disconnected: (%@)", | |
session.sessionId]; | |
NSLog(@"sessionDidDisconnect (%@)", alertMessage); | |
//TalkingWithLabel.text = @""; | |
//Change the text of the status label | |
StatusLabel.text = [self getSessionStatus]; | |
//Change the status label color | |
[self changeStatusLabelColor]; | |
//Clean all the subscribers | |
[self cleanupSubscriber]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment