Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 911 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 911 Bytes

OpenVidu php client

Php port of openvidu-java-client, library simplifing openvidu server connection using it's exposed REST API.

Install

Installation via Composer.

composer require stopka/openvidu-php-client "dev-master@dev" 

Usage examples

Usage should be similar to the original java client API.

Create session

$openvidu = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET);
$sessionProperties = new SessionPropertiesBuilder();
$session = $openVidu->createSession($sessionProperties->build());

Generate token

$tokenOptions = new TokenOptions\TokenOptionsBuilder();
$tokenOptions->setRole(OpenViduRoleEnum::PUBLISHER)
            ->setData(json_encode($tokenData));
$token = $session->generateToken($tokenOptions->build());