I'm building an app using this tutorial (using using parse.com and OpenTok). When I initiate a call, the following delegate method -- session:(OTSession *)session streamCreated:(OTStream *)stream delegate method never gets called. I have searched around and it seems others have had this error but no one seems to have found a solution.
The cloud code module deployed on the parse servers seems to execute fine without errors and give no issues. But the video stream is never initiated.
The streamCreated method looks like this:
-(void)session:(OTSession *)session streamCreated:(OTStream *)stream {
NSLog(@"session: didReceiveStream:");
NSLog(@"- connection.connectionId: %@", stream.connection.connectionId);
NSLog(@"- connection.creationTime: %@", stream.connection.creationTime);
NSLog(@"- session.sessionId: %@", stream.session.sessionId);
NSLog(@"- streamId: %@", stream.streamId);
NSLog(@"- creationTime %@", stream.creationTime);
NSLog(@"- name %@", stream.name);
NSLog(@"- hasAudio %@", (stream.hasAudio ? @"YES" : @"NO"));
NSLog(@"- hasVideo %@", (stream.hasVideo ? @"YES" : @"NO"));
if ( (subscribeToSelf && [stream.connection.connectionId isEqualToString: _session.connection.connectionId])
||
(!subscribeToSelf && ![stream.connection.connectionId isEqualToString: _session.connection.connectionId])
) {
if (!_subscriber) {
_subscriber = [[OTSubscriber alloc] initWithStream:stream delegate:self];
_subscriber.subscribeToAudio = self.bAudio;
_subscriber.subscribeToVideo = self.bVideo;
}
NSLog(@"subscriber.session.sessionId: %@", _subscriber.session.sessionId);
NSLog(@"- stream.streamId: %@", _subscriber.stream.streamId);
NSLog(@"- subscribeToAudio %@", (_subscriber.subscribeToAudio ? @"YES" : @"NO"));
NSLog(@"- subscribeToVideo %@", (_subscriber.subscribeToVideo ? @"YES" : @"NO"));
}
}
Does anyone have any ideas at all? I'm new to OpenTok and would appreciate any advice. Thanks in advance.
For the complete project code, see the linked tutorial. I have not modified the code in any way with the exception of implementing the API secret for OpenTok and my Parse credentials. I have also hosted the .h and .m files on this dropbox page.