PHPackages                             opentok/opentok - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. opentok/opentok

ActiveLibrary[Image &amp; Media](/categories/media)

opentok/opentok
===============

OpenTok is a platform for creating real time streaming video applications, created by TokBox.

v4.21.3(2mo ago)1413.0M—0.6%141[7 issues](https://github.com/opentok/Opentok-PHP-SDK/issues)[2 PRs](https://github.com/opentok/Opentok-PHP-SDK/pulls)10MITPHPPHP ^8.1|^8.2|^8.3|^8.4|^8.5CI failing

Since Mar 7Pushed 2mo ago63 watchersCompare

[ Source](https://github.com/opentok/Opentok-PHP-SDK)[ Packagist](https://packagist.org/packages/opentok/opentok)[ Docs](https://github.com/opentok/Opentok-PHP-SDK)[ RSS](/packages/opentok-opentok/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (24)Versions (104)Used By (10)

OpenTok PHP SDK
===============

[](#opentok-php-sdk)

> ## Notice
>
> [](#notice)
>
> This library is designed to work with the Tokbox/OpenTok platform, part of the Vonage Video API. If you are looking to use the Vonage Video API and using the Vonage Customer Dashboard, you will want to install the Vonage Server SDK for PHP, which includes support for the Vonage Video API.
>
> Not sure which exact platform you are using? Take a look at [this guide](https://api.support.vonage.com/hc/en-us/articles/10817774782492).
>
> If you are using the Tokbox platform, do not worry! The Tokbox platform is not going away, and this library will continue to be updated. While we encourage customers to check out the new Unified platform, there is no rush to &gt; switch. Both platforms run the exact same infrastructure and capabilities, with the main difference is a unified billing interface and easier access to [Vonage’s other CPaaS APIs](https://www.vonage.com/communications-apis/).
>
> If you are new to the Vonage Video API, head on over to the [Vonage Customer Dashboard](https://dashboard.vonage.com) to sign up for a developer account and check out the \[Vonage Server SDK for \](link to core SDK).

[![Build Status](https://camo.githubusercontent.com/14ad26a783f5e20be12baab0babb90e3bfa0cd2f3261a9c0adfeac9b99e76158/68747470733a2f2f7472617669732d63692e6f72672f6f70656e746f6b2f4f70656e546f6b2d5048502d53444b2e737667)](https://travis-ci.org/opentok/OpenTok-PHP-SDK) [![Contributor Covenant](https://camo.githubusercontent.com/2757a9db291c5ceda172e31d4fa5f3c4048a6e6257ee0b7113f80de277074b91/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e7472696275746f72253230436f76656e616e742d76322e3025323061646f707465642d6666363962342e737667)](CODE_OF_CONDUCT.md)

[![Tokbox is now known as Vonage](https://camo.githubusercontent.com/9d2626eba29e8bd52a9fde8cd39db3cac23ba85859f87568c3d16739440da832/68747470733a2f2f6173736574732e746f6b626f782e636f6d2f696d672f766f6e6167652f566f6e6167655f566964656f4150495f626c61636b2e737667)](https://camo.githubusercontent.com/9d2626eba29e8bd52a9fde8cd39db3cac23ba85859f87568c3d16739440da832/68747470733a2f2f6173736574732e746f6b626f782e636f6d2f696d672f766f6e6167652f566f6e6167655f566964656f4150495f626c61636b2e737667)

The OpenTok PHP SDK provides methods for:

- Generating [sessions](https://tokbox.com/developer/guides/create-session/) and [tokens](https://tokbox.com/developer/guides/create-token/) for [OpenTok](https://www.tokbox.com/) applications that run on the .NET platform
- Working with [OpenTok archives](https://tokbox.com/opentok/tutorials/archiving)
- Working with [OpenTok live streaming broadcasts](https://tokbox.com/developer/guides/broadcast/live-streaming/)
- Working with [OpenTok SIP interconnect](https://tokbox.com/developer/guides/sip)
- [Sending signals to clients connected to a session](https://tokbox.com/developer/guides/signaling/)
- [Disconnecting clients from sessions](https://tokbox.com/developer/guides/moderation/rest/)
- [Forcing clients in a session to disconnect or mute published audio](https://tokbox.com/developer/guides/moderation/)
- Working with OpenTok [Audio Connector](https://tokbox.com/developer/guides/audio-connector)

Installation
------------

[](#installation)

### Composer (recommended):

[](#composer-recommended)

Composer helps manage dependencies for PHP projects. Find more info here:

Add this package (`opentok/opentok`) to your `composer.json` file, or run the following at the command line:

```
$ composer require opentok/opentok ^4.0
```

Usage
-----

[](#usage)

### Initializing

[](#initializing)

This package follows the [PSR-4](http://www.php-fig.org/psr/psr-4/) autoloading standard. If you are using composer to install, you just require the generated autoloader:

```
require "/vendor/autoload.php";
```

Once the files of the SDK are loaded, you initialize an `OpenTok\OpenTok` object with your own API Key and API Secret.

```
use OpenTok\OpenTok;

$opentok = new OpenTok($apiKey, $apiSecret);
```

#### Initialization Options

[](#initialization-options)

The `OpenTok\OpenTok` object just allow for some overrides of values when special needs arise, such as needing to point to a different datacenter or change the timeout of the underlying HTTP client. For these situations, you can pass an array of additional options as the third parameter.

We allow the following options:

- `apiUrl` - Change the domain that the SDK points to. Useful when needing to select a specific datacenter or point to a mock version of the API for testing
- `client` - Custom API client that inherits from `OpenTok\Utils\Client`, useful for customizing an HTTP client
- `timeout` - Change the default HTTP timeout, which defaults to forever. You can pass a number of seconds to change the timeout.

```
use OpenTok\OpenTok;
use MyCompany\CustomOpenTokClient;

$options = [
    'apiUrl' => 'https://custom.domain.com/',
    'client' => new CustomOpenTokClient(),
    'timeout' => 10,
]
$opentok = new OpenTok($apiKey, $apiSecret, $options);
```

#### Migrating to Vonage Video API

[](#migrating-to-vonage-video-api)

There is some useful behaviour on initialization in this SDK that will help as a stopgap before switching out from the legacy TokBok API to the new, Vonage Video API. To do this, you can pass in an Application ID for the API Key, and the path to a Vonage private key as the API Secret.

```
use OpenTok\OpenTok;
use MyCompany\CustomOpenTokClient;

$applicationID = '61bb2dae-9b69-400c-9abb-642d082af5fc';
$privateKey = './private.key';

$opentok = new OpenTok($applicationID, $privateKey);
```

The SDK will notice that the authentiction has changed, and will automatically start to forward requests to the Vonage API Routes instead of the OpenTok API Routes. All requests and responses in your code should be exactly the same as they are on the OpenTok API.

**NOTE:** The SDK will read the private key path from the root directory of your project (generally one level above the docroot of your application), so you will need to make sure that the path provided is either absolute, or relative to your project root.

### Creating Sessions

[](#creating-sessions)

To create an OpenTok Session, use the `createSession($options)` method of the `OpenTok\OpenTok` class. The `$options` parameter is an optional array used to specify the following:

- Setting whether the session will use the OpenTok Media Router or attempt to send streams directly between clients.
- Setting whether the session will automatically create archives (implies use of routed session)
- Specifying a location hint.

The `getSessionId()` method of the `OpenTok\Session` instance returns the session ID, which you use to identify the session in the OpenTok client libraries.

```
use OpenTok\MediaMode;
use OpenTok\ArchiveMode;

// Create a session that attempts to use peer-to-peer streaming:
$session = $opentok->createSession();

// A session that uses the OpenTok Media Router, which is required for archiving:
$session = $opentok->createSession(array( 'mediaMode' => MediaMode::ROUTED ));

// A session with a location hint:
$session = $opentok->createSession(array( 'location' => '12.34.56.78' ));

// An automatically archived session:
$sessionOptions = array(
    'archiveMode' => ArchiveMode::ALWAYS,
    'mediaMode' => MediaMode::ROUTED
);
$session = $opentok->createSession($sessionOptions);

// Store this sessionId in the database for later use
$sessionId = $session->getSessionId();
```

### Generating Tokens

[](#generating-tokens)

Once a Session is created, you can start generating Tokens for clients to use when connecting to it. You can generate a token either by calling the `generateToken($sessionId, $options)` method of the `OpenTok\OpenTok` class, or by calling the `generateToken($options)` method on the `OpenTok\Session`instance after creating it. The `$options` parameter is an optional array used to set the role, expire time, and connection data of the Token. For layout control in archives and broadcasts, the initial layout class list of streams published from connections using this token can be set as well.

```
use OpenTok\Session;
use OpenTok\Role;

// Generate a Token from just a sessionId (fetched from a database)
$token = $opentok->generateToken($sessionId);
// Generate a Token by calling the method on the Session (returned from createSession)
$token = $session->generateToken();

// Set some options in a token
$token = $session->generateToken(array(
    'role'       => Role::MODERATOR,
    'expireTime' => time()+(7 * 24 * 60 * 60), // in one week
    'data'       => 'name=Johnny',
    'initialLayoutClassList' => array('focus')
));
```

### Working with Streams

[](#working-with-streams)

You can get information about a stream by calling the `getStream($sessionId, $streamId)` method of the `OpenTok\OpenTok` class.

```
use OpenTok\Session;

// Get stream info from just a sessionId (fetched from a database)
$stream = $opentok->getStream($sessionId, $streamId);

// Stream properties
$stream->id; // string with the stream ID
$stream->videoType; // string with the video type
$stream->name; // string with the name
$stream->layoutClassList; // array with the layout class list
```

You can get information about all the streams in a session by calling the `listStreams($sessionId)` method of the `OpenTok\OpenTok` class.

```
use OpenTok\Session;

// Get list of streams from just a sessionId (fetched from a database)
$streamList = $opentok->listStreams($sessionId);

$streamList->totalCount(); // total count
```

### Working with Archives

[](#working-with-archives)

You can only archive sessions that use the OpenTok Media Router (sessions with the media mode set to routed).

You can start the recording of an OpenTok Session using the `startArchive($sessionId, $name)` method of the `OpenTok\OpenTok` class. This will return an `OpenTok\Archive` instance. The parameter `$archiveOptions` is an optional array and is used to assign a name, whether to record audio and/or video, the desired output mode for the Archive, and the desired resolution if applicable. Note that you can only start an Archive on a Session that has clients connected.

```
// Create a simple archive of a session
$archive = $opentok->startArchive($sessionId);

// Create an archive using custom options
$archiveOptions = array(
    'name' => 'Important Presentation',     // default: null
    'hasAudio' => true,                     // default: true
    'hasVideo' => true,                     // default: true
    'outputMode' => OutputMode::COMPOSED,   // default: OutputMode::COMPOSED
    'resolution' => '1280x720'              // default: '640x480'
);
$archive = $opentok->startArchive($sessionId, $archiveOptions);

// Store this archiveId in the database for later use
$archiveId = $archive->id;
```

If you set the `outputMode` option to `OutputMode::INDIVIDUAL`, it causes each stream in the archive to be recorded to its own individual file. Please note that you cannot specify the resolution when you set the `outputMode` option to `OutputMode::INDIVIDUAL`. The `OutputMode::COMPOSED` setting (the default) causes all streams in the archive to be recorded to a single (composed) file.

Note that you can also create an automatically archived session, by passing in `ArchiveMode::ALWAYS`as the `archiveMode` key of the `options` parameter passed into the `OpenTok->createSession()`method (see "Creating Sessions," above).

You can stop the recording of a started archive using the `stopArchive($archiveId)` method of the `OpenTok\OpenTok` object. You can also do this using the `stop()` method of the `OpenTok\Archive` instance.

```
// Stop an Archive from an archiveId (fetched from database)
$opentok->stopArchive($archiveId);
// Stop an Archive from an Archive instance (returned from startArchive)
$archive->stop();
```

To get an `OpenTok\Archive` instance (and all the information about it) from an archive ID, use the `getArchive($archiveId)` method of the `OpenTok\OpenTok` class.

```
$archive = $opentok->getArchive($archiveId);
```

To delete an Archive, you can call the `deleteArchive($archiveId)` method of the `OpenTok\OpenTok`class or the `delete()` method of an `OpenTok\Archive` instance.

```
// Delete an Archive from an archiveId (fetched from database)
$opentok->deleteArchive($archiveId);
// Delete an Archive from an Archive instance (returned from startArchive, getArchive)
$archive->delete();
```

You can also get a list of all the Archives you've created (up to 1000) with your API Key. This is done using the `listArchives($offset, $count, $sessionId)` method of the `OpenTok/OpenTok` class. The parameters `$offset`, `$count`, and `$sessionId` are optional and can help you paginate through the results, and subset the data by a specific session. This will return an instance of the `OpenTok\ArchiveList` class.

```
$archiveList = $opentok->listArchives();

// Get an array of OpenTok\Archive instances
$archives = $archiveList->getItems();
// Get the total number of Archives for this API Key
$totalCount = $archiveList->totalCount();
```

For composed archives, you can change the layout dynamically, using the `setArchiveLayout($archiveId, $layoutType)` method:

```
use OpenTok\OpenTok;

$layout = Layout::getPIP(); // Or use another get method of the Layout class.
$opentok->setArchiveLayout($archiveId, $layout);
```

You can set the initial layout class for a client's streams by setting the `layout` option when you create the token for the client, using the `OpenTok->generateToken()` method or the `Session->generateToken()` method. And you can change the layout classes for a stream by calling the `OpenTok->updateStream()` method.

Setting the layout of composed archives is optional. By default, composed archives use the "best fit" layout (see [Customizing the video layout for composed archives](https://tokbox.com/developer/guides/archiving/layout-control.html)).

For more information on archiving, see the [OpenTok archiving](https://tokbox.com/developer/guides/archiving/) developer guide.

### Working with Broadcasts

[](#working-with-broadcasts)

You can only start live streaming broadcasts for sessions that use the OpenTok Media Router (sessions with the media mode set to routed).

Start the live streaming broadcast of an OpenTok Session using the `startBroadcast($sessionId, $options)` method of the `OpenTok\OpenTok` class. This will return an `OpenTok\Broadcast` instance. The `$options` parameter is an array used to define the broadcast streams, assign broadcast options such as layout, maxDuration, resolution, and more.

```
// Define options for the broadcast
$options = [
  'layout' => Layout::getBestFit(),
  'maxDuration' => 5400,
  'resolution' => '1280x720',
  'output' => [
    'hls' => [
      'dvr' => true,
      'lowLatency' => false
    ],
    'rtmp' => [
      [
        'id' => 'foo',
        'serverUrl' => 'rtmps://myfooserver/myfooapp',
        'streamName' => 'myfoostream'
      ],
      [
        'id' => 'bar',
        'serverUrl' => 'rtmps://myfooserver/mybarapp',
        'streamName' => 'mybarstream'
      ],
    ]
  ]
];

// Start a live streaming broadcast of a session
$broadcast = $opentok->startBroadcast($sessionId, $options);

// Store the broadcast ID in the database for later use
$broadcastId = $broadcast->id;
```

You can stop the live streaming broadcast using the `stopBroadcast($broadcastId)` method of the `OpenTok\OpenTok` object. You can also do this using the `stop()` method of the `OpenTok\Broadcast` instance.

```
// Stop a broadcast from an broadcast ID (fetched from database)
$opentok->stopBroadcast($broadcastId);

// Stop a broadcast from an Broadcast instance (returned from startBroadcast)
$broadcast->stop();
```

To get an `OpenTok\Broadcast` instance (and all the information about it) from a broadcast ID, use the `getBroadcast($broadcastId)` method of the `OpenTok\OpenTok` class.

```
$broadcast = $opentok->getBroadcast($broadcastId);
```

You can set change the layout dynamically, using the `OpenTok->updateBroadcastLayout($broadcastId, $layout)` method:

```
use OpenTok\OpenTok;

$layout = Layout::getPIP(); // Or use another get method of the Layout class.
$opentok->updateBroadcastLayout($broadcastId, $layout);
```

You can use the `Layout` class to set the layout types: `Layout::getHorizontalPresentation()`, `Layout::getVerticalPresentation()`, `Layout::getPIP()`, `Layout::getBestFit()`, `Layout::createCustom()`.

```
$layoutType = Layout::getHorizontalPresentation();
$opentok->setArchiveLayout($archiveId, $layoutType);

// For custom Layouts, you can do the following
$options = array(
    'stylesheet' => 'stream.instructor {position: absolute; width: 100%;  height:50%;}'
);

$layoutType = Layout::createCustom($options);
$opentok->setArchiveLayout($archiveId, $layoutType);
```

You can also set the Screenshare Layout by calling the `setScreenshareType()` method on a layout object.

```
$layout = Layout::getBestFit(); // Other types are not currently supported
$layout->setScreenshareType(Layout::LAYOUT_VERTICAL);
```

You can set the initial layout class for a client's streams by setting the `layout` option when you create the token for the client, using the `OpenTok->generateToken()` method or the `Session->generateToken()` method. And you can change the layout classes for a stream by calling the `OpenTok->updateStream()` method.

Setting the layout of live streaming broadcasts is optional. By default, broadcasts use the "best fit" layout (see [Configuring video layout for OpenTok live streaming broadcasts](https://tokbox.com/developer/guides/broadcast/live-streaming/#configuring-video-layout-for-opentok-live-streaming-broadcasts)).

For more information on live streaming broadcasts, see the [OpenTok live streaming broadcasts](https://tokbox.com/developer/guides/broadcast/live-streaming/)developer guide.

### Force a Client to Disconnect

[](#force-a-client-to-disconnect)

Your application server can disconnect a client from an OpenTok session by calling the `forceDisconnect($sessionId, $connectionId)`method of the `OpenTok\OpenTok` class.

```
use OpenTok\OpenTok;

// Force disconnect a client connection
$opentok->forceDisconnect($sessionId, $connectionId);
```

### Forcing clients in a session mute published audio

[](#forcing-clients-in-a-session-mute-published-audio)

You can force the publisher of a specific stream to stop publishing audio using the `Opentok.forceMuteStream($sessionId, $stream)` method.

You can force the publisher of all streams in a session (except for an optional list of streams) to stop publishing audio using the `Opentok.forceMuteAll($sessionId, $excludedStreamIds)` method. You can then disable the mute state of the session by calling the `Opentok.DisableForceMute(sessionId)` or `Opentok.DisableForceMuteAsync(sessionId)`method.

### Sending Signals

[](#sending-signals)

Once a Session is created, you can send signals to everyone in the session or to a specific connection. You can send a signal by calling the `signal($sessionId, $payload, $connectionId)` method of the `OpenTok\OpenTok` class.

The `$sessionId` parameter is the session ID of the session.

The `$payload` parameter is an associative array used to set the following:

- `data` (string) -- The data string for the signal. You can send a maximum of 8kB.
- `type` (string) -- — (Optional) The type string for the signal. You can send a maximum of 128 characters, and only the following characters are allowed: A-Z, a-z, numbers (0-9), '-', '\_', and '~'.

The `$connectionId` parameter is an optional string used to specify the connection ID of a client connected to the session. If you specify this value, the signal is sent to the specified client. Otherwise, the signal is sent to all clients connected to the session.

```
use OpenTok\OpenTok;

// Send a signal to a specific client
$signalPayload = array(
    'data' => 'some signal message',
    'type' => 'signal type'
);
$connectionId = 'da9cb410-e29b-4c2d-ab9e-fe65bf83fcaf';
$opentok->signal($sessionId, $signalPayload, $connectionId);

// Send a signal to everyone in the session
$signalPayload = array(
    'data' => 'some signal message',
    'type' => 'signal type'
);
$opentok->signal($sessionId, $signalPayload);
```

For more information, see the [OpenTok signaling developer guide](https://tokbox.com/developer/guides/signaling/).

### Working with SIP Interconnect

[](#working-with-sip-interconnect)

You can add an audio-only stream from an external third-party SIP gateway using the SIP Interconnect feature. This requires a SIP URI, the session ID you wish to add the audio-only stream to, and a token to connect to that session ID.

To initiate a SIP call, call the `dial($sessionId, $token, $sipUri, $options)` method of the `OpenTok\OpenTok` class:

```
$sipUri = 'sip:user@sip.partner.com;transport=tls';

$options = array(
  'headers' =>  array(
    'X-CUSTOM-HEADER' => 'headerValue'
  ),
  'auth' => array(
    'username' => 'username',
    'password' => 'password'
  ),
  'secure' => true,
  'from' => 'from@example.com'
);

$opentok->dial($sessionId, $token, $sipUri, $options);
```

For more information, see the [OpenTok SIP Interconnect developer guide](https://tokbox.com/developer/guides/sip/).

### Working with Audio Connector

[](#working-with-audio-connector)

You can start an [Audio Connector](https://tokbox.com/developer/guides/audio-connector) WebSocket by calling the `connectAudio()` method of the `OpenTok\OpenTok` class.

Samples
-------

[](#samples)

There are three sample applications included in this repository. To get going as fast as possible, clone the whole repository and follow the Walkthroughs:

- [HelloWorld](sample/HelloWorld/README.md)
- [Archiving](sample/Archiving/README.md)
- [SipCall](sample/SipCall/README.md)

Documentation
-------------

[](#documentation)

Reference documentation is available at .

Requirements
------------

[](#requirements)

You need an OpenTok API key and API secret, which you can obtain by logging into your [Vonage Video API account](https://tokbox.com/account).

The OpenTok PHP SDK requires PHP 7.2 or higher.

Release Notes
-------------

[](#release-notes)

See the [Releases](https://github.com/opentok/opentok-php-sdk/releases) page for details about each release.

Important changes since v2.2.0
------------------------------

[](#important-changes-since-v220)

**Changes in v2.2.1:**

The default setting for the `createSession()` method is to create a session with the media mode set to relayed. In previous versions of the SDK, the default setting was to use the OpenTok Media Router (media mode set to routed). In a relayed session, clients will attempt to send streams directly between each other (peer-to-peer); if clients cannot connect due to firewall restrictions, the session uses the OpenTok TURN server to relay audio-video streams.

**Changes in v2.2.0:**

This version of the SDK includes support for working with OpenTok archives.

The names of many methods of the API have changed. Many method names have changed to use camel case, including the following:

- `\OpenTok\OpenTok->createSession()`
- `\OpenTok\OpenTok->generateToken()`

Note also that the `options` parameter of the `OpenTok->createSession()` method has a `mediaMode`property instead of a `p2p` property.

The API\_Config class has been removed. Store your OpenTok API key and API secret in code outside of the SDK files.

See the reference documentation  and in the docs directory of the SDK.

Running code quality tooling
----------------------------

[](#running-code-quality-tooling)

This library makes use of two code quality tools, plus a full PHPUnit test suite.

- [phpcs](https://github.com/squizlabs/PHP_CodeSniffer)

To run phpcs, enter the following on the command line:

```
 $ composer run phpcs
```

- [phpstan](https://github.com/phpstan/phpstan)

To run phpstan, enter the following on the command line:

```
 $ composer run phpstan
```

- [phpunit](https://phpunit.de/)

To run PhpUnit, enter the following on the command line:

```
 $ composer run test
```

Development and Contributing
----------------------------

[](#development-and-contributing)

Interested in contributing? We ❤️ pull requests! See the [Development](DEVELOPING.md) and [Contribution](CONTRIBUTING.md) guidelines.

Getting Help
------------

[](#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:

- Open an issue on this repository
- See  for support options
- Tweet at us! We're [@VonageDev on Twitter](https://twitter.com/VonageDev)
- Or [join the Vonage Developer Community Slack](https://developer.nexmo.com/community/slack)

###  Health Score

76

—

ExcellentBetter than 100% of packages

Maintenance85

Actively maintained with recent releases

Popularity61

Solid adoption and visibility

Community46

Growing community involvement

Maturity97

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~84 days

Recently: every ~38 days

Total

57

Last Release

67d ago

Major Versions

v1.0 → v2.2.02014-05-27

v2.5.1 → v3.0.02017-06-30

v3.1.1 → v4.0.0-alpha.12018-02-09

PHP version history (5 changes)v1.0PHP &gt;=5.0.0

v3.0.0PHP &gt;=5.6.0

v4.6.0PHP ^7.2

v4.8.0PHP ^7.2|^8.0

v4.21.0PHP ^8.1|^8.2|^8.3|^8.4|^8.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2683897?v=4)[Vonage](/maintainers/Vonage)[@Vonage](https://github.com/Vonage)

![](https://www.gravatar.com/avatar/efc1f4119b02a988612122f19b2e021c8e919e5018f645d453a62b47064790b2?d=identicon)[SecondeJK](/maintainers/SecondeJK)

![](https://www.gravatar.com/avatar/b5d20fe6d997eac860ef707739ddaaa488af04d448b7f9870770e3e5f8dad3c7?d=identicon)[aoberoi](/maintainers/aoberoi)

![](https://www.gravatar.com/avatar/15962b167796b1c1b78cc05d74ce5294215a9ecf2aaed1166fb38727b7a73d11?d=identicon)[opentok](/maintainers/opentok)

---

Top Contributors

[![aoberoi](https://avatars.githubusercontent.com/u/494795?v=4)](https://github.com/aoberoi "aoberoi (209 commits)")[![SecondeJK](https://avatars.githubusercontent.com/u/17067659?v=4)](https://github.com/SecondeJK "SecondeJK (166 commits)")[![jeffswartz](https://avatars.githubusercontent.com/u/726379?v=4)](https://github.com/jeffswartz "jeffswartz (90 commits)")[![dragonmantank](https://avatars.githubusercontent.com/u/108948?v=4)](https://github.com/dragonmantank "dragonmantank (76 commits)")[![aiham](https://avatars.githubusercontent.com/u/609164?v=4)](https://github.com/aiham "aiham (54 commits)")[![msach22](https://avatars.githubusercontent.com/u/16408856?v=4)](https://github.com/msach22 "msach22 (28 commits)")[![digitaltsai](https://avatars.githubusercontent.com/u/382658?v=4)](https://github.com/digitaltsai "digitaltsai (15 commits)")[![thissophie](https://avatars.githubusercontent.com/u/7331?v=4)](https://github.com/thissophie "thissophie (13 commits)")[![songz](https://avatars.githubusercontent.com/u/686933?v=4)](https://github.com/songz "songz (7 commits)")[![michaeljolley](https://avatars.githubusercontent.com/u/1228996?v=4)](https://github.com/michaeljolley "michaeljolley (6 commits)")[![Taracque](https://avatars.githubusercontent.com/u/373777?v=4)](https://github.com/Taracque "Taracque (5 commits)")[![hbaqai](https://avatars.githubusercontent.com/u/5265309?v=4)](https://github.com/hbaqai "hbaqai (3 commits)")[![manchuck](https://avatars.githubusercontent.com/u/192776?v=4)](https://github.com/manchuck "manchuck (3 commits)")[![phoenixcw](https://avatars.githubusercontent.com/u/1329836?v=4)](https://github.com/phoenixcw "phoenixcw (2 commits)")[![manasdpradhan](https://avatars.githubusercontent.com/u/1490361?v=4)](https://github.com/manasdpradhan "manasdpradhan (2 commits)")[![mkascel](https://avatars.githubusercontent.com/u/125464?v=4)](https://github.com/mkascel "mkascel (2 commits)")[![djoos](https://avatars.githubusercontent.com/u/449510?v=4)](https://github.com/djoos "djoos (2 commits)")[![pardel](https://avatars.githubusercontent.com/u/2171?v=4)](https://github.com/pardel "pardel (2 commits)")[![rskuipers](https://avatars.githubusercontent.com/u/1918518?v=4)](https://github.com/rskuipers "rskuipers (2 commits)")[![pincombe](https://avatars.githubusercontent.com/u/3033010?v=4)](https://github.com/pincombe "pincombe (1 commits)")

---

Tags

opentokphpphp-sdktokboxphpstreamingvideoWebRTCTokBoxOpenTok

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/opentok-opentok/health.svg)

```
[![Health](https://phpackages.com/badges/opentok-opentok/health.svg)](https://phpackages.com/packages/opentok-opentok)
```

###  Alternatives

[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[happyworm/jplayer

jPlayer allows you to create a media player with a consistent interface and experience across all browsers.

4.6k114.2k1](/packages/happyworm-jplayer)[dereuromark/media-embed

A PHP library to deal with all those media services around, parsing their URLs and embedding their audio/video content in websites.

182530.3k11](/packages/dereuromark-media-embed)[muxinc/mux-php

Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.

522.1M11](/packages/muxinc-mux-php)[daun/statamic-mux

Seamless video encoding and streaming using Mux on Statamic sites

132.3k](/packages/daun-statamic-mux)[automattic/wistia-php

PHP wrapper for Wistia API

1431.9k](/packages/automattic-wistia-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
