PHP code example of wangyi-live / netease

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

    

wangyi-live / netease example snippets


use netease\app\Netease;
$Netease = new Netease(AppSecret,AppSecret);

$res = $Netease->liveChannelAdd(频道名称, 频道类型(0:rtmp));

$res = $Netease->liveChannelUpdate(频道名,频道ID,频道类型 ( 0 : rtmp));

$res = $Netease->liveChannelDel(频道ID);

$res = $Netease->liveChannelGet(频道ID);

$res = $Netease->channel_list();

$res = $Netease->channel_reset(频道ID);

$res = $Netease->channel_setRecord([
    'cid' => 频道ID,
    'needRecord' => 1-开启录制; 0-关闭录制,
    'format' => 1-flv; 0-mp4,
    'duration' => 录制切片时长(分钟),5~120分钟
]);

$res = $Netease->channel_pause(频道ID);

$res = $Netease->channel_resume(频道ID);

$res = $Netease->channel_pauselist([
    频道ID
]);

$res = $Netease->channel_resumelist([
    频道ID
]);

$res = $Netease->channel_videolist(频道ID);