Bigbluebutton Integration in Laravel
Hello everyone, in this blog we will learn about how we can integrate bigbluebutton in Laravel before moving forward let’s know something about bigbluebutton
What is Bigbluebutton?
BigBlueButton is a free software web conferencing system for GNU/Linux servers. In addition to various web conferencing services, it has integrations for many of the major learning and content management systems, for more information which please visit this URL.
I thought now you get to know what is bigbluebutton all about let’s proceed with the installation part.
Installation
- Install the Laravel using composer
composer create-project laravel/laravel example-app
- Now we will install bigbluebutton package via composer
composer require joisarjignesh/bigbluebutton
- Define security salt in your .env file
BBB_SECURITY_SALT=bbb_secret_key
BBB_SERVER_BASE_URL=https://example.com/bigbluebutton/
If you want security salt from the server please visit this URL
- After Define salt and url clear old configurations
php artisan optimize:clear
After install and clear old configuration check a url and security salt is working.
dd(\Bigbluebutton::isConnect()); //by default
dd(\Bigbluebutton::server('server1')->isConnect()); //for specific server
When you run the above code you will get the response like the below one
true
Now parameters for creating a meeting
You can create meeting by passing below array
\Bigbluebutton::create([
'meetingID' => 'codehunger',
'meetingName' => 'CodeHunger Meeting',
'attendeePW' => 'ap',
'moderatorPW' => 'mp'
]);
When run the above code you will get the below response
llluminate\Support\Collection Object (
[items:protected] => Array (
[returncode] => SUCCESS
[meetingID] => codehungers
[internalMeetingID] => dc4d06a55074733d607a74bd409149016b6df811-1608808732341
[parentMeetingID] => bbb-none
[attendeePW] => ap
[moderatorPW] => mp
[createTime] => 1608808732341
[voiceBridge] => 86321
[dialNumber] => 613-555-1234
[createDate] => Thu Dec 24 11:18:52 UTC 2020
[hasUserJoined] => false
[duration] => 0
[hasBeenForciblyEnded] => false
[messageKey] => Array ( )
[message] => Array ( )
))
Another way of creating meeting by passing more parameter
Pass parameter like the below one
$createMeeting = \Bigbluebutton::initCreateMeeting([
'meetingID' => 'codehunger',
'meetingName' => 'CodeHunger meeting',
'attendeePW' => 'ap',
'moderatorPW' => 'mp',
'presentation' => [ //if you want to add presentation
['link' => 'https://www.example.com/doc.pdf', 'fileName' => 'doc.pdf'], //first will be default and current slide in meeting
['link' => 'https://www.example.com/php_tutorial.pptx', 'fileName' => 'php_tutorial.pptx'],
],
// you can add you own endback url
'endCallbackUrl' => 'www.example.com/callback',
// you can add your logout url also
'logoutUrl' => 'www.example.com/logout',
]);
// after that additional parameter like below
$createMeeting->setDuration(100); //overwrite default configuration
\Bigbluebutton::create($createMeeting);
Below is the list of all additional parameter which you can pass during meeting creation.
- $createMeeting->setRecord(‘true’);
- $createMeeting->setWelcomeMessage(‘Hello User’);
- $createMeeting->setMaxParticipants(10);
- $createMeeting->setModeratorOnlyMessage(‘Moderator message’);
- $createMeeting->setAutoStartRecording(‘true’);
- $createMeeting->setMuteOnStart(‘true’);
- $createMeeting->setwebcamsOnlyForModerator(‘true’);
- $createMeeting->setlogo(‘url’);
- $createMeeting->setcopyright(‘copyright’);
- $createMeeting->setlockSettingsDisableCam(‘true’);
- $createMeeting->setlockSettingsDisableMic(‘true’);
- $createMeeting->setlockSettingsDisablePrivateChat(‘true’);
- $createMeeting->setlockSettingsDisablePublicChat(‘true’);
- $createMeeting->setlockSettingsDisablePrivateChat(‘true’);
- $createMeeting->setlockSettingsDisableNote(‘true’);
- $createMeeting->setlockSettingsHideUserList(‘true’);
- $createMeeting->setlockSettingsLockedLayout(‘true’);
- $createMeeting->setlockSettingsLockOnJoin(‘true’);
- $createMeeting->setlockSettingsLockOnJoinConfigurable(‘true’);
- $createMeeting->setallowModsToUnmuteUsers(‘true’);
Note -: You can find more about the create meeting parameter under vendor\bigbluebutton\bigbluebutton-api-php\src\Parameters\CreateMeetingParameter.php line number 932
Join a meeting as moderator
To Join the meeting you can pass the below array
return redirect()->to(
\Bigbluebutton::join([
'meetingID' => 'codehunger',
'userName' => 'disa',
'password' => 'mp' //which user role want to join set password here
])
);
If everything is good up to now, then you will be redirected to bigbluebutton screen and see something like the below screenshot
Join a meeting as a attendee
To Join the meeting you can pass the below array
return redirect()->to(
\Bigbluebutton::join([
'meetingID' => 'codehunger',
'userName' => 'disa',
'password' => 'ap' //which user role want to join set password here
])
);
when you join as attendee you can see the below screenshot
I hope you like the blog for more information about the bigbluebutton please visit this url .