This package contains what you need to get you started using the OpenTok iOS SDK.
The OpenTok iOS SDK lets you use OpenTok video sessions in apps you build for iPad, iPhone, and iPod touch devices. This means you can use OpenTok video sessions that connect iOS users with each other and with web clients. For information on OpenTok, see http://tokbox.com/.
Documentation of the SDK is available here:
The OpenTokHelloWorld project is simplest sample app. The OpenTokBasic sample uses more of the API. These sample apps are also at GitHub:
Support is available at the OpenTok forums: http://www.tokbox.com/forums/
September 17, 2003 - Version 1.4.3
- Fixed a bug that caused clients running iOS 7 to crash.
May 16, 2013 - Version 1.4.2
- Fixed some issues with running OpenTok applications in the background.
- Added native support for armv7s architecture.
- Fixed a bug that was causing inconsistent UI when manipulating media track functions (e.g. publishVideo, subscribeToAudio, etc.)
April 9, 2013 - Version 1.4.1
- Corrected the name of
[OTPublisherDelegate publisher:didChangeCameraPosition:]message. (See the notes for April 5, 2013.)
April 5, 2013 - Version 1.4.0
- You can now specify the camera a publisher uses by setting the
[OTPublisher cameraPosition]property. The OTPublisherDelegate sends the
[OTPublisherDelegate publisherDidChange:cameraPosition:]message in response to a camera change.
- Publishers and subscribers now continue to publish and subscribe to streams when running in the background.
- This release includes bug fixes to improve performance and stability.
August 3, 2012 - Version 1.2.0
- This release officially supports 3G and 4G in addition to wifi internet connections.
- Video quality in iOS is markedly improved in this release.
- This release officially supports image snapshot functionality.
June 5, 2012
- Added OTVideoView, which gives view hierarchy access to components of a viewable object.
April 23, 2012
- Fixed a bug where the aspect ratio for publishers was incorrect at certain orientations.
- Improved average connection time for subscribers. Delegates should receive the [OTSubscriberDelegate subscriberVideoDataReceived:] message a bit faster.
April 5, 2012
- [OTPublisher cameraPosition] -- The preferred camera position. When setting this property, if the change is possible, the publisher will use the camera with the specified position. If the publisher has begun publishing, getting this property returns the current camera position; if the publisher has not yet begun publishing, getting this property returns the preferred camera position. Valid values are defined in the AVCaptureDevicePosition enum.
The OpenTok iOS SDK supports iOS 5 and later only.
You cannot publish streams in the iOS Simulator. Build and deploy to a supported iOS device.
Our graphics rendering pipeline causes this error to be logged when debugging: "CGContextDrawImage: invalid context 0x0." This should not affect the performance of your app. If you experience video quality issues, please let us know.
iOS 6.1.3 seems to have some issues when the OpenTok library is running in the background. We are investigating this.
For other issues, check the RELEASE_NOTES.txt file in the libOpentok directory.
The OpenTok iOS SDK requires XCode 4.2 or later. XCode 4.2 requires Mac OS 10.6.8 or later.
You need to test OpenTok apps on an iOS device running iOS 5. The OpenTok iOS SDK supports iPhone 3GS (subscribing only), iPhone 4 and higher, iPod touch 4th generation and higher, and all iPad versions.
To test OpenTok apps on an iOS device, you will need to register as an Apple iOS developer at http://developer.apple.com/programs/register/.
Download the latest version of the OpenTok iOS SDK.
Download the OpenTokHelloWorld sample app and the OpenTok iOS SDK. The OpenTokHelloWorld app publishes to a demo session, and subscribes to its own stream (or any other stream in the session). Included in the sample app directory is the OpenTok iOS library and other files you will need to develop your own apps:
Opentok.framework -- Add this framework to your project. Note that to use the library you must also include the Opentok.bundle file and the headers included in in the Frameworks directory of the OpenTokHelloWorld sample app.
Opentok.bundle -- Add the Opentok.bundle file to your project. The Opentok.bundle file is located in the Opentok.framework/Versions/A/Resources subdirectory of the OpenTok iOS SDK.
Frameworks directory -- The OpenTok iOS library uses linked frameworks and dynamic libraries provided by iOS. We cannot pre-link them in the OpenTok framework, so your project must link them. Expand the "Frameworks" directory of the sample application in XCode project browser. Drag and drop the contents of this directory into your own iOS project.
You can generate a new session ID at this URL:
You can also create a web page that connects to the same session as the OpenTokHello sample app.
The samples directory includes the following apps:
- The OpenTokHello sample app shows the most basic functionality of the OpenTok iOS SDK: connecting to sessions, publishing streams, and subscribing to streams.
- The OpenTokFullTutorial sample app uses more of the OpenTok iOS SDK than the OpenTokHello sample app does.
Here are the basic steps in creating your own app:
In XCode, create a new project. The simplest application is a Single-View application.
Open the project navigator in Xcode.
Drag the Opentok.framework directory from the Mac OS Finder to the Frameworks directory for for your project in XCode.
Drag the Opentok.bundle file from the Mac OS Finder to root directory for your project in XCode.
The Opentok.bundle file is located in the Opentok.framework/Versions/A/Resources subdirectory of the OpenTok iOS SDK.
The OpenTok framework requires a few other frameworks and libraries to be added to your project. The easiest way to add them is to copy them from the OpenTokHello sample app.
Open the OpenTokHello sample app in XCode. Drag all of the additional frameworks from the frameworks folder (in the project navigator) of the OpenTokHello project into the frameworks folder of your project.
The additional frameworks and libraries include the following: AudioToolbox.framework, AVFoundation.framework, CFNetwork.framework, CoreAudio.framework, CoreMedia.framework, CoreTelephony.framework, CoreVideo.framework, libz.dylib, libstdc++.dylib, MobileCoreServices.framework, OpenGLES.framework, QuartzCore.framework, Security.framework, SystemConfiguration.framework.
When running in the background, the OpenTok SDK requires certain Info.pList settings to continue publishing and subscribing to audio video streams. In XCode, open Info tab for your app's target and add a Required Background Modes entry (if it does not already exist). Add the following to the list of required background modes:
- App plays audio
- App provides Voice over IP services
In the ViewController.h file, add the following line (after
Assuming that your ViewController will implement the OTSessionDelegate, OTPublisherDelegate, and OTSubscriberDelegate protocols, edit the
@interfacedeclaration in the ViewController.h file to the following:
@interface ViewController : UIViewController <OTSessionDelegate, OTSubscriberDelegate, OTPublisherDelegate>
You will need to implement the required method in each protocol that you add (OTSessionDelegate, OTSubscriberDelegate, OTPublisherDelegate).
Add code to initialize and connect to an OpenTok session. And add code to publish and subscribe to streams. See the code in the OpenTokHello application.
Your comments and questions are welcome. Come join the conversation at the OpenTok iOS SDK forum.