1. Go to this page and download the library: Download rtippin/janus-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/ */
use RTippin\Janus\Facades\Janus;
$info = Janus::info() || Janus::getInstance()->info();
namespace App\Http\Controllers;
use RTippin\Janus\Janus;
class JanusController
{
private Janus $janus;
public function __construct(Janus $janus)
{
$this->janus = $janus;
}
}
Janus::info();
Janus::ping();
use RTippin\Janus\Facades\Janus;
Route::get('test', function(){
Janus::debug()->ping();
dump('It dumps inline for each http call!');
});
//OUTPUT
"PAYLOAD"
array:3 [▼
"transaction" => "q52xpYrZJ6e6"
"apisecret" => "secret"
"janus" => "ping"
]
"RESPONSE"
array:2 [▼
"janus" => "pong"
"transaction" => "q52xpYrZJ6e6"
]
"LATENCY"
16.0
"It dumps inline for each http call!"
use RTippin\Janus\Facades\Janus;
//Send our command for the results we want.
Janus::connect()
->attach('janus.plugin.videoroom')
->message(['request' => 'list']);
//Set the results from the last command sent.
$rooms = Janus::getApiResponse();
//Disconnect and reset all janus values.
Janus::disconnect();
use RTippin\Janus\Facades\Janus;
//Disable disconnects for plugin calls.
Janus::videoRoom()->withoutDisconnect();
//Grab list of rooms.
$rooms = Janus::videoRoom()->list()['list'];
//Destroy each room.
foreach ($rooms as $room) {
Janus::videoRoom()->destroy($room['room']);
}
//Now disconnect to remove our session/handle.
Janus::videoRoom()->disconnect(true); //Forced on current plugin instance.
---------------------------------------------------------------------------
Janus::disconnect(); //Main disconnect will always be run if called.
use RTippin\Janus\Facades\Janus;
$videoRoom = Janus::videoRoom();
namespace App\Http\Controllers;
use RTippin\Janus\Plugins\VideoRoom;
class VideoRoomController
{
private VideoRoom $videoRoom;
public function __construct(VideoRoom $videoRoom)
{
$this->videoRoom = $videoRoom;
}
}
use RTippin\Janus\Facades\Janus;
//Disable disconnect between each method call.
Janus::videoRoom()->withoutDisconnect();
//Run methods as needed. Connect and attach will only be called once.
if (Janus::videoRoom()->exists(12345678)['exists']) {
Janus::videoRoom()->destroy(12345678);
}
//Disconnect and reset all janus values.
Janus::disconnect();
bash
php artisan vendor:publish --tag=janus
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.