forked from QuickBlox/quickblox-ios-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Igor Khomenko
committed
Jul 17, 2014
1 parent
846ebcf
commit 32747b7
Showing
31 changed files
with
1,543 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<h2> QuickBlox Sample VideoChat iOS</h2> | ||
This is a code sample for [QuickBlox](http://quickblox.com/) platform. It is a great way for developers using QuickBlox platform to learn how to integrate 1 on 1 video conference into your application. | ||
|
||
Original sample description & setup guide - [http://quickblox.com/developers/SimpleSample-videochat-ios](http://quickblox.com/developers/SimpleSample-videochat-ios) | ||
|
||
![VideoChat sample Home screen](http://files.quickblox.com/iOS-QB_VideoChat_sample2.png) ![Video conference](http://files.quickblox.com/iOS-QB_VideoChat_sample1.png) | ||
|
||
<h3>Important - how to build your own VideoChat app</h3> | ||
|
||
If you want to build your own iOS VideoChat app, please do the following:<br /> | ||
1) download the project from here (GIT)<br /> | ||
2) register a QuickBlox account (if you don't have one yet): http://admin.quickblox.com/register<br /> | ||
3) log in to QuickBlox admin panel http://admin.quickblox.com/signin<br /> | ||
4) create a new app and create two users in that app - IMPORTANT: make the username and the password for each user the same. For example: if you make the first username johntest1 it needs to have the password also as johntest1 <br /> | ||
5) click on the app title in the list to reveal app details:<br /> | ||
|
||
![App credentials](http://files.quickblox.com/QuickBlox_application_credentials.png) | ||
|
||
6) copy credentials (App ID, Authorization key, Authorization secret) into your VideoChat project code along with the two users you created. Since the username and the password are the same, you do not need to put separately the username and password in the code but only the name (for example johntest1) along with the ID of the user in the file /VideoChat-sample-ios/AppDelegate.m<br /> | ||
7) Enjoy! |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// AppDelegate.h | ||
// SimpleSample-videochat-ios | ||
// | ||
// Created by QuickBlox team on 1/02/13. | ||
// Copyright (c) 2013 QuickBlox. All rights reserved. | ||
// | ||
// | ||
// This class sets QuickBlox credentials | ||
// Then shows splash screen where you have to create QuickBlox session with user in order to use QuickBlox API. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface AppDelegate : UIResponder <UIApplicationDelegate>{ | ||
} | ||
|
||
@property (strong, nonatomic) UIWindow *window; | ||
|
||
/* VideoChat test opponents */ | ||
@property (strong, nonatomic) NSArray *testOpponents; | ||
|
||
/* Current logged in test user*/ | ||
@property (assign, nonatomic) int currentUser; | ||
|
||
@end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// | ||
// AppDelegate.m | ||
// SimpleSample-videochat-ios | ||
// | ||
// Created by QuickBlox team on 1/02/13. | ||
// Copyright (c) 2013 QuickBlox. All rights reserved. | ||
// | ||
|
||
#import "AppDelegate.h" | ||
#import "MainViewController.h" | ||
#import "SplashViewController.h" | ||
|
||
@implementation AppDelegate | ||
@synthesize window = _window; | ||
@synthesize testOpponents; | ||
@synthesize currentUser; | ||
|
||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
{ | ||
|
||
[application setIdleTimerDisabled:YES]; | ||
|
||
// | ||
// There are 2 tests opponents: | ||
// | ||
// User1: | ||
// -ID: 65421 | ||
// -login: videoChatUser1 | ||
// -password: videoChatUser1pass | ||
// User2: | ||
// -ID: 65422 | ||
// -login: videoChatUser2 | ||
// -password: videoChatUser2pass | ||
self.testOpponents = @[@"videoChatUser1", @"videoChatUser1pass", @65421, | ||
@"videoChatUser2", @"videoChatUser2pass", @65422]; | ||
// | ||
// Set QuickBlox credentials. Register at admin.quickblox.com, create a new app | ||
// and copy credentials here to have your own backend instance enabled. | ||
[QBSettings setApplicationID:92]; | ||
[QBSettings setAuthorizationKey:@"wJHdOcQSxXQGWx5"]; | ||
[QBSettings setAuthorizationSecret:@"BTFsj7Rtt27DAmT"]; | ||
[QBSettings setAccountKey:@"7yvNe17TnjNUqDoPwfqp"]; | ||
|
||
|
||
NSMutableDictionary *videoChatConfiguration = [[QBSettings videoChatConfiguration] mutableCopy]; | ||
[videoChatConfiguration setObject:@20 forKey:kQBVideoChatCallTimeout]; | ||
[videoChatConfiguration setObject:AVCaptureSessionPresetLow forKey:kQBVideoChatFrameQualityPreset]; | ||
[videoChatConfiguration setObject:@2 forKey:kQBVideoChatVideoFramesPerSecond]; | ||
[videoChatConfiguration setObject:@3 forKey:kQBVideoChatP2PTimeout]; | ||
[videoChatConfiguration setObject:@10 forKey:kQBVideoChatBadConnectionTimeout]; | ||
[QBSettings setVideoChatConfiguration:videoChatConfiguration]; | ||
|
||
|
||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | ||
self.window.backgroundColor = [UIColor whiteColor]; | ||
|
||
// Show Splash screen | ||
// | ||
SplashViewController *splashViewController = [[SplashViewController alloc] init]; | ||
[self.window setRootViewController:splashViewController]; | ||
|
||
[self.window makeKeyAndVisible]; | ||
|
||
return YES; | ||
} | ||
|
||
- (void)applicationWillResignActive:(UIApplication *)application | ||
{ | ||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. | ||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. | ||
} | ||
|
||
- (void)applicationDidEnterBackground:(UIApplication *)application | ||
{ | ||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. | ||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | ||
} | ||
|
||
- (void)applicationWillEnterForeground:(UIApplication *)application | ||
{ | ||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. | ||
} | ||
|
||
- (void)applicationDidBecomeActive:(UIApplication *)application | ||
{ | ||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. | ||
} | ||
|
||
- (void)applicationWillTerminate:(UIApplication *)application | ||
{ | ||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | ||
} | ||
|
||
@end |
41 changes: 41 additions & 0 deletions
41
...-videochat/VideoChat-sample-ios/Resources/Media.xcassets/AppIcon.appiconset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "iphone", | ||
"size" : "29x29", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"size" : "29x29", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"size" : "40x40", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "57x57", | ||
"idiom" : "iphone", | ||
"filename" : "icon57.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "57x57", | ||
"idiom" : "iphone", | ||
"filename" : "icon114.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "60x60", | ||
"idiom" : "iphone", | ||
"filename" : "icon120.png", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+5.05 KB
...at/VideoChat-sample-ios/Resources/Media.xcassets/AppIcon.appiconset/icon114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.73 KB
...at/VideoChat-sample-ios/Resources/Media.xcassets/AppIcon.appiconset/icon120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.36 KB
...hat/VideoChat-sample-ios/Resources/Media.xcassets/AppIcon.appiconset/icon57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions
47
...ochat/VideoChat-sample-ios/Resources/Media.xcassets/LaunchImage.launchimage/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"orientation" : "portrait", | ||
"idiom" : "iphone", | ||
"extent" : "full-screen", | ||
"minimum-system-version" : "7.0", | ||
"filename" : "Launch3_5R-1.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"extent" : "full-screen", | ||
"idiom" : "iphone", | ||
"subtype" : "retina4", | ||
"filename" : "Launch4R.png", | ||
"minimum-system-version" : "7.0", | ||
"orientation" : "portrait", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"orientation" : "portrait", | ||
"idiom" : "iphone", | ||
"extent" : "full-screen", | ||
"filename" : "Launch3_5.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"orientation" : "portrait", | ||
"idiom" : "iphone", | ||
"extent" : "full-screen", | ||
"filename" : "Launch3_5R.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"orientation" : "portrait", | ||
"idiom" : "iphone", | ||
"extent" : "full-screen", | ||
"filename" : "Launch4R-1.png", | ||
"subtype" : "retina4", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+14.7 KB
...oChat-sample-ios/Resources/Media.xcassets/LaunchImage.launchimage/Launch3_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.9 KB
...at-sample-ios/Resources/Media.xcassets/LaunchImage.launchimage/Launch3_5R-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.9 KB
...Chat-sample-ios/Resources/Media.xcassets/LaunchImage.launchimage/Launch3_5R.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.7 KB
...Chat-sample-ios/Resources/Media.xcassets/LaunchImage.launchimage/Launch4R-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.7 KB
...eoChat-sample-ios/Resources/Media.xcassets/LaunchImage.launchimage/Launch4R.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions
17
...videochat/VideoChat-sample-ios/Resources/Media.xcassets/callAccept.imageset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x", | ||
"filename" : "callAccept.png" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+61.1 KB
...ideoChat-sample-ios/Resources/Media.xcassets/callAccept.imageset/callAccept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions
17
...videochat/VideoChat-sample-ios/Resources/Media.xcassets/callReject.imageset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x", | ||
"filename" : "callReject.png" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+20.4 KB
...ideoChat-sample-ios/Resources/Media.xcassets/callReject.imageset/callReject.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions
17
sample-videochat/VideoChat-sample-ios/Resources/Media.xcassets/person.imageset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x", | ||
"filename" : "person.png" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+44.3 KB
...eochat/VideoChat-sample-ios/Resources/Media.xcassets/person.imageset/person.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
43 changes: 43 additions & 0 deletions
43
sample-videochat/VideoChat-sample-ios/ViewController/MainViewController/MainViewController.h
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// MainViewController.h | ||
// SimpleSample-videochat-ios | ||
// | ||
// Created by QuickBlox team on 1/02/13. | ||
// Copyright (c) 2013 QuickBlox. All rights reserved. | ||
// | ||
// | ||
// This class demonstrates how to work with VideoChat API. | ||
// It shows how to setup video conference between 2 users | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import <AVFoundation/AVFoundation.h> | ||
|
||
@interface MainViewController : UIViewController <QBChatDelegate, AVAudioPlayerDelegate, UIAlertViewDelegate>{ | ||
IBOutlet UIButton *callButton; | ||
IBOutlet UILabel *ringigngLabel; | ||
IBOutlet UIActivityIndicatorView *callingActivityIndicator; | ||
IBOutlet UIActivityIndicatorView *startingCallActivityIndicator; | ||
IBOutlet UIImageView *opponentVideoView; | ||
IBOutlet UIImageView *myVideoView; | ||
IBOutlet UINavigationBar *navBar; | ||
IBOutlet UISegmentedControl *audioOutput; | ||
IBOutlet UISegmentedControl *videoOutput; | ||
|
||
AVAudioPlayer *ringingPlayer; | ||
|
||
// | ||
NSUInteger videoChatOpponentID; | ||
enum QBVideoChatConferenceType videoChatConferenceType; | ||
NSString *sessionID; | ||
} | ||
|
||
@property (strong) NSNumber *opponentID; | ||
@property (strong) QBVideoChat *videoChat; | ||
@property (strong) UIAlertView *callAlert; | ||
|
||
- (IBAction)call:(id)sender; | ||
- (void)reject; | ||
- (void)accept; | ||
|
||
@end |
Oops, something went wrong.