PHP code example of jtipsy / cloudletter

1. Go to this page and download the library: Download jtipsy/cloudletter 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/ */

    

jtipsy / cloudletter example snippets

shell

 Jtipsy\Cloudletter\Netease;

 $appKey = 'xxxxxxxxx';
 $appSecret = 'xxxxxxxxx';
 $appHost = 'https://yiyong-xedu-v2.netease.im/';
 $appAuthorization = 'xxxxxxxxx';
 $uuid = 1;
 $roomName = 'jtipsy的直播间';
 $roomUuid = 1;
 $configId = '7';
 $live = false;
 $rtc = true;
 $chatroom = true;
 $whiteboard = true;

 $netease = new Netease($appKey,$appSecret,$appHost,$appAuthorization);

 // 获取云课堂用户Token
 $token = $netease->createUser($uuid);

 // 创建云课堂房间
 $room = $netease->createRoom($roomName,$roomUuid,$configId,$live,$rtc,$chatroom,$whiteboard);

 // 关闭云课堂房间
 $shut = $netease->shutRoom($roomUuid);

 // 获取回放
 $record = $netease->recordPlayBack($roomUuid,$rtcCid);
 
shell
 config/services.php 配置如下:
 
 'netease' => [
    'appKey' => env('NETEASE_APP_KEY',NULL),
    'appSecret' => env('NETEASE_APP_SECRET',NULL),
    'appHost' => env('NETEASE_APP_HOST',NULL),
    'appAuthorization' => env('NETEASE_APP_AUTHORIZATION',NULL),
 ],