PHP code example of royalcms / live

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

    

royalcms / live example snippets


use Royalcms\Component\Live\Paas\Room;
use Royalcms\Component\Live\Paas\Document;

$config = [
	'app_id' => 'xxxx', // 控制台中获取
	'secret_key' => 'xxx', // 控制台中获取
	'show_request_url' => false, // 是否显示构造请求连接&参数 json console (请勿在生产环境打开)
	'show_request_data' => false, // 是否显示接口返回数据 json console (请勿在生产环境打开)
];

// 实例化直播对象
$roomObj = new Room($config);

// 创建房间
$resultCreate = $roomObj->create();

// 获取房间列表
$resultList = $roomObj->lists();

// 实例化文档对象
$roomObj = new Document($config);

// 文档参数填写
$params = [
	// 文档要写绝对路径
    'document' => __DIR__. "/test.pptx"
];

// 创建文档
$resultCreate = $roomObj->create($params);


// 创建房间
$resultCreate = RC_Live::room()->create($params);

var_dump($resultCreate);