PHP code example of pkc / video-call

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

    

pkc / video-call example snippets


Route::get('/video-call/{room}', function($room) {
    return view('video-call::room', [
        'room' => $room,
        'targetUserId' => request()->query('target_user'),
    ]);
})->middleware(['auth']);

// In your blade view
<a href="{{ route('video-call.room', ['room' => 'unique-room-id', 'target_user' => $userId]) }}">
    Start Video Call
</a>

return [
    'stun_servers' => [
        'stun:stun.l.google.com:19302',
        'stun:stun1.l.google.com:19302',
    ],
    'turn_servers' => [
        // Add your TURN servers here
        // [
        //     'urls' => 'turn:your-turn-server.com:3478',
        //     'username' => 'username',
        //     'credential' => 'credential'
        // ]
    ],
    'video_constraints' => [
        'width' => 640,
        'height' => 480,
        'frameRate' => 30,
    ],
];
bash
php artisan vendor:publish --provider="kpr\VideoCall\VideoCallServiceProvider"