Code Monkey home page Code Monkey logo

opentok-ios-sdk-samples-swift's Introduction

Build Status

OpenTok iOS SDK Samples

This repository is meant to provide some examples for you to better understand the features of the OpenTok iOS SDK. The sample applications are meant to be used with the latest version of the OpenTok iOS SDK. Feel free to copy and modify the source code herein for your own projects. Please consider sharing your modifications with us, especially if they might benefit other developers using the OpenTok iOS SDK. See the License for more information.

Quick Start

  1. Get values for your OpenTok API key, session ID, and token. See Obtaining OpenTok Credentials for important information.

  2. Install CocoaPods as described in CocoaPods Getting Started.

  3. In Terminal, cd to your project directory and type pod install.

  4. Reopen your project in Xcode using the new Opentok-iOS-samples.xcworkspace file.

  5. In the ViewController.swift file, replace the following empty strings with the corresponding API Key, session ID, and token values:

    // *** Fill the following variables using your own Project info  ***
    // ***            https://tokbox.com/account/#/                  ***
    // Replace with your OpenTok API key
    let kApiKey = ""
    // Replace with your generated session ID
    let kSessionId = ""
    // Replace with your generated token
    let kToken = ""
  6. Use Xcode to build and run the app on an iOS simulator or device.

What's Inside

Each of the projects build on the lessons of the previous. After reviewing each, you will have an understanding of the OpenTok iOS SDK API. Additionally, you will be able to get started with writing your own extensions to the default capture implementations provided herein.

  1. Basics -- This basic application demonstrates a short path to getting started with the OpenTok iOS SDK.

  2. Custom Video Driver -- This project provides classes that implement the OTVideoCapture and OTVideoRender interfaces of the core Publisher and Subscriber classes. Using these modules, we can see the basic workflow of sourcing video frames from the device camera in and out of OpenTok, via the OTPublisherKit and OTSubscriberKit interfaces.

  3. Custom-Audio-Driver -- This project demonstrate how to use an external audio source with the OpenTok SDK. This project utilizes CoreAudio and the AUGraph API to create an audio session suitable for voice and video communications.

  4. Screen-Sharing -- This project demonstrates how to use a custom video capturer to publish a stream that uses a UI view (instead of a camera) as the video source.

  5. Live-Photo-Capture -- This project extends the video capture module implemented in project 2, and demonstrates how the AVFoundation media capture APIs can be used to simultaneously stream video and capture high-resolution photos from the same camera.

  6. Simple-Multiparty -- This project demonstrates how to use the OpenTok iOS SDK for a multi-party call. The application publishes audio/video from an iOS device and can connect to multiple subscribers. However it shows only one subscriber video at a time due to CPU limitations on iOS devices.

Obtaining OpenTok Credentials

To use the OpenTok platform you need a session ID, token, and API Key. You can get these values by creating a project on your OpenTok Account Page and scrolling down to the Project Tools section of your Project page. For production deployment, you must generate the session ID and token values using one of the OpenTok Server SDKs.

opentok-ios-sdk-samples-swift's People

Contributors

robjperez avatar lucashuang0802 avatar jeffswartz avatar

Watchers

James Cloos avatar Sergei Bokatuk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.