• Stars
    star
    200
  • Rank 195,325 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 11 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example applications that use the OpenTok iOS SDK

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 run pod install.

  4. Open your project in Xcode using the new .xcworkspace file in the project directory.

  5. Set up some config settings for the app. This varies, depending on the project.

  • For the Archiving, Basic-Video-Chat, and Signaling projects, in the Config.h file, replace the following empty strings with the base URL of the server that implements the learning-opentok-php or learning-opentok-node projects:

    #define SAMPLE_SERVER_BASE_URL @"https://YOUR-SERVER-URL"

    For more information, see the instructions on setting up these servers in the OpenTok tutorials at the OpenTok developer center

* For all other projects, in the ViewController.m file, replace the following empty strings
  with the corresponding API key, session ID, and token values:

  ```objc
  // *** Fill the following variables using your own Project info  ***
  // ***          https://dashboard.tokbox.com/projects            ***
  // Replace with your OpenTok API key
  static NSString* const kApiKey = @"";
  // Replace with your generated session ID
  static NSString* const kSessionId = @"";
  // Replace with your generated token
  static NSString* const kToken = @"";
  ```
  1. Use Xcode to build and run the app on an iOS simulator or device.

What's Inside

Archiving - This application shows you how to record an OpenTok session.

Basic Video Chat - This basic application demonstrates a short path to getting started with the OpenTok iOS SDK.

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.

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.

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.

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.

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.

Signaling - This project shows you how to implement text chat using the OpenTok signaling API.

Overlay Graphics - This project shows how to overlay graphics for the following:

  • A button for muting the publisher microphone

  • A button for muting the subscriber audio

  • Stream quality notification icons for the subscriber video

  • Archive recording icons

This project barrows publisher and subscribers modules implemented in project 2.

Audio Levels - This project demonstrates how to use the OpenTok iOS SDK for audio-only multi party calls. Both publisher and subscribers are audio-based only. This application also shows how to use the audio level API along with an audio meter UI for visualization of publisher and subscriber audio levels.

Ringtones - This project extends on the work done in Project 3 (Custom Audio Driver) by extending the sample audio driver with an AVAudioPlayer controller, which will play a short ringtone while waiting for the subscriber to connect to the client device.

FrameMetadata -- This project shows how to set metadata (limited to 32 bytes) to a video frame, as well as how to read metadata from a video frame.

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.

Development and Contributing

Interested in contributing? We ❤️ pull requests! See the Contribution guidelines.

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

Further Reading

More Repositories

1

opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
Java
211
star
2

opentok-react-native

OpenTok React Native - a library for OpenTok iOS and Android SDKs
Swift
211
star
3

opentok-web-samples

Sample applications for using OpenTok.js
JavaScript
196
star
4

opentok-node

OpenTok Server SDK for node.js
JavaScript
165
star
5

OpenTok-PHP-SDK

OpenTok PHP Server SDK
PHP
140
star
6

opentok-ios-sdk-samples-swift

Sample applications using the OpenTok iOS SDK in Swift
Swift
136
star
7

opentok-network-test

Sample app to test network connectivity and statistics (bps, packet-lost)
Objective-C
111
star
8

CallKit

A sample app to demonstrate how to integrate Apple CallKit into OpenTok iOS SDK
Objective-C
110
star
9

OpenTok-Ruby-SDK

OpenTok Server SDK for Ruby
Ruby
110
star
10

opentok-react

React components for OpenTok.js
JavaScript
107
star
11

opentok-rtc

OpenTok demo application
JavaScript
106
star
12

one-to-one-sample-apps

DEPRECATED: OpenTok One-to-One Communication Sample App
JavaScript
99
star
13

screensharing-extensions

Sample code for developing an OpenTok screen-sharing extension for Google Chrome and Firefox
HTML
80
star
14

Opentok-Python-SDK

OpenTok Python SDK
Python
73
star
15

Opentok-.NET-SDK

Official .NET Server SDK for OpenTok
C#
57
star
16

opentok-network-test-js

A node module that lets you check network connectivity to resources and services required to use OpenTok
TypeScript
57
star
17

broadcast-sample-app

OpenTok Broadcast Sample Application
JavaScript
54
star
18

opentok-react-native-samples

Sample applications using OpenTok and React Native
Java
52
star
19

accelerator-sample-apps-js

CSS
35
star
20

archiving-composer

Sample apps for using OpenTok archiving building blocks API and ffmpeg to generate composed files from individual archives
JavaScript
31
star
21

accelerator-core-ios

Syntax sugar of OpenTok iOS SDK with Audio/Video communication including screen sharing
Objective-C
31
star
22

learning-opentok-web

JavaScript
27
star
23

Opentok-Java-SDK

OpenTok Server SDK for Java
Java
26
star
24

learning-opentok-ios

Sample code for learning how to use the OpenTok iOS SDK
Objective-C
26
star
25

accelerator-core-js

Accelerator Core provides a simple way to integrate real-time audio/video into your web application using the OpenTok Platform
JavaScript
25
star
26

learning-opentok-php

PHP
25
star
27

learning-opentok-android

Java
25
star
28

opentok-video-call-center

Sample code for building a basic agent queuing system
Vue
20
star
29

opentok-elearning-samples

Sample applications highlighting integrations between OpenTok and Learning Management Systems (LMS)
JavaScript
19
star
30

opentok-linux-sdk-samples

OpenTok Linux SDK Samples
C++
16
star
31

web-components

Web Components to be used with OpenTok video
JavaScript
16
star
32

ARKitSample

Sample App using ARKit Apple framework
Swift
16
star
33

accelerator-screen-sharing-js

Accelerator Screen Sharing JS provides an easy way to get started in implementing interoperable screen sharing using the OpenTok platform.
JavaScript
16
star
34

opentok-hardware-setup.js

JavaScript
14
star
35

interactive-broadcast-js

JavaScript
13
star
36

accelerator-textchat-ios

OpenTok Text Chat Accelerator Pack enables text messages between mobile or browser-based devices.
Objective-C
13
star
37

learning-opentok-node

A sample app of OpenTok Node Server SDK
JavaScript
13
star
38

opentok-flutter-basic-video-chat

Kotlin
11
star
39

ARFrameMetadata

Sample application using the Frame Meta Data API on iOS with ARKit
Swift
10
star
40

opentok-webinar

Simple Webinar (1 to many broadcast) application powered by OpenTok WebRTC SDKs https://tokinar.herokuapp.com/
JavaScript
10
star
41

accelerator-sample-apps-ios

A comprehensive sample app built by OpenTok Accelerator Packs
Objective-C
10
star
42

json2code

Code generator for JSON serialization and deserialization on iOS and Android based on json schema
Java
9
star
43

opentok-windows-sdk-samples

Sample applications illustrating best practices using OpenTok Windows SDK
C#
9
star
44

accelerator-core-android

An easy way to integrate OpenTok SDK to any Android applications
Java
8
star
45

opentok-reconnection

Sample app to illustrate how reconnection feature works.
Java
7
star
46

insights-dashboard-sample

Sample React app utilizing the OpenTok Insights GraphQL API
JavaScript
6
star
47

accelerator-textchat-js

Accelerator Text Chat JS provides functionality you can add to your OpenTok applications that enables users to exchange text messages between mobile or browser-based devices.
JavaScript
6
star
48

opentok-archive-transcription-demo

Sample code for transcribing OpenTok video archives to text
JavaScript
5
star
49

interactive-broadcast-api

JavaScript
5
star
50

ux-components

Reusable React Components for TokBox
TypeScript
5
star
51

opentok-nexmo-sip

OpenTok SIP Interconnect samples with Nexmo Voice API
JavaScript
5
star
52

accelerator-sample-apps-android

A sample app built by OpenTok Accelerator Packs
Kotlin
4
star
53

accelerator-annotation-android

Java
4
star
54

interactive-broadcast-android

Java
3
star
55

accelerator-annotation-js

JavaScript
2
star
56

misc-opentok-accelerators

DEPRECATED: Old versions of the OpenTok Accelerator packs
JavaScript
2
star
57

accelerator-textchat-android

Accelerator Text Chat Android provides functionality you can add to your OpenTok applications that enables users to exchange text messages between mobile or browser-based devices.
Java
2
star
58

opentok-macos-sdk-samples

Objective-C
2
star
59

token-encoder

Generates tokens for `X-TB-TOKEN-AUTH` header when using OpenTok REST API.
JavaScript
2
star
60

opentok-swiftui-basic-video-chat

Swift
1
star
61

opentok-jwt

Node module to generate a JWT token given an apiKey and secret.
JavaScript
1
star
62

opentok-embed-appointment

A simple demo for setting up appointments with the OpenTok Embed
JavaScript
1
star