PHP code example of stopka / openvidu-php-client

1. Go to this page and download the library: Download stopka/openvidu-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stopka / openvidu-php-client example snippets


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

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