Skip to content
This repository

Titanium module for using Opentok iOS SDK

tree: 8069777ba3

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

opentok-titanium-mobile

A module for the Titanium Mobile platform that uses the Opentok iOS SDK for video streaming capabilities.

Installation

  1. Go to the Downloads page and download the latest version of the module.

  2. Move the zip file (come.tokbox.ti.opentok-iphone-x.x.x.zip) to your Titanium SDK directory. This is usually either ~/Library/Application Support/Titanium or /Library/Application Support/Titanium.

Building

If you want to build the code on your own, follow these instructions. If you just want to use the module, scroll down to Usage.

  1. Clone or download the repo, run ./build.py in the directory

  2. Copy the zip (com.tokbox.ti.opentok-iphone-x.x.zip) to your Titanium installation directory: cp com.tokbox.ti.opentok-iphone-x.x.zip /Library/Application\ Support/Titanium/.

Usage

  1. Declare the module and the asset path in in your tiapp.xml file:

    <modules>
      <module version="0.2.1">com.tokbox.ti.opentok</module>
    </modules>
    <ios>
      <plist>
        <dict>
          <key>OTAssetBundlePath</key>
          <string>modules/com.tokbox.ti.opentok</string>
        </dict>
      </plist>
    </ios>
    
  2. Load the module in your application

    var opentok = require('com.tokbox.ti.opentok');
    
  3. Create and connect to a session

    var CONFIG = {
      apiKey: '...',    // Get from Opentok website (http://www.tokbox.com/opentok/api/tools/js/apikey)
      sessionId: '...', // Generated by server-side SDK
      token: '...'      // Generated by server-side SDK
    };
    var session = opentok.createSession({ sessionId: CONFIG.sessionId });
    session.connect(CONFIG.apiKey, CONFIG.token);
    
  4. For more details, see the module documentation and the example.

Requirements

  • Titanium SDK 2.1 or later

  • iOS SDK 5.0 or later

  • Opentok API Key. Get one here.

  • Opentok.framework requires projects to be built for only i386 (simulator) and armv7 (device); armv6 is not supported.

Getting Help

You can find help by posting your question to the Github Issues page, posting on the TokBox forums, or asking in the #opentok IRC channel.

Known Issues

If you are experiencing any problems, please look at the Github Issues page for known issues.

Notes

  • If you are building for the device for the first time you may see the following error:

    [ERROR] clang: error: linker command failed with exit code 1 (use -v to see invocation)

    This can be because Titanium is trying to compile for armv6, which is unsupported. See the Wiki Page for two ways to solve this.

  • Opentok.framework can be downloaded from the official repo

  • Publishing is not supported in the Simulator because it does not have access to your webcam.

  • The API is currently a mix of the Opentok web API, iOS specifics, and Titanium conventions. These are subject to change. Suggestions welcome.

  • open source contributions welcome :)

License

Copyright (c) 2012 TokBox, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

The software complies with Terms of Service for the OpenTok platform described in http://www.tokbox.com/termsofservice

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.