GithubHelp home page GithubHelp logo

php-bigbluebutton's Introduction

PHP BigBlueButton API Library

BigBlueButton is an open source web conferencing system for on-line learning. โ€“ http://www.bigbluebutton.org

This is a php library to interface with a BigBlueButton server instance.

Supported PHP-FIG Recommendations

Installation

This package is Composer compatible. Install Composer on your system to use it. The run

composer require sanduhrs/php-bigbluebutton

Configuration

To get your API URL and secret login to your BigBlueButton server and run:

$ bbb-conf --secret
       URL: http://example.org/bigbluebutton/
    Secret: aiShaiteih6nahchie1quaiyul8ce4Zu

Usage

Initialize a BigBlueButton object:

<?php

require_once 'vendor/autoload.php';

use sanduhrs\BigBlueButton;

$url = 'http://example.org/bigbluebutton/';
$secret = 'aiShaiteih6nahchie1quaiyul8ce4Zu';
$endpoint = 'api/';

// Initialize a BigBlueButton object.
$bbb = new BigBlueButton($url, $secret, $endpoint);

Get the version of the remote server:

$version = $bbb->server->getVersion();

Add a meeting:

$meeting = $bbb->server->addMeeting([
    'id' => '123-456-789-000',
    'attendeePW' => 'Guphei4i',
    'moderatorPW' => 'ioy9Xep9',
    'name' => 'A BigBlueButton meeting',
    'welcome' => 'Welcome to %%CONFNAME%%.',
    'logoutURL' => 'https://example.org/',
    'record' => true,
    'autoStartRecording' => true,
    'meta'  => [
        'bbb-recording-ready-url' => urlencode('https://example.com/api/v1/recording_status'),
        'presenter' => 'John Smith',
    ],
    //any other parameters from [BBB API Documentation](https://docs.bigbluebutton.org/dev/api.html#create)
]);

Add a meeting with pre-uploaded slides:

$meeting = [
    'id' => '123-456-789-001',
    'name' => 'A BigBlueButton meeting with custom slides',
];
$meeting['slides'][] = new Document(
   'https://example.org/slide.png',
   'slide.png',
);
$meeting = $bbb->server->addMeeting($meeting);

Get meeting join URL for a moderator:

$full_name = 'Martin Moderator';
$url = $meeting->join($full_name, true);

Get meeting join URL for an attendee:

$full_name = 'Anton Attendee';
$url = $meeting->join($full_name);

Full Usage Example

Initialize your project with Composer:

composer init

Install this package and its dependencies:

composer require sanduhrs/php-bigbluebutton

Copy this to a file called 'index.php', adjust the '$url' and '$secret' variables, then try out your setup:

<?php

require_once 'vendor/autoload.php';

use sanduhrs\BigBlueButton;

$url = 'http://example.org/bigbluebutton/';
$secret = 'aiShaiteih6nahchie1quaiyul8ce4Zu';
$endpoint = 'api/';

// Initialize a BigBlueButton object.
$bbb = new BigBlueButton($url, $secret, $endpoint);

// Get the version of the remote server.
$version = $bbb->server->getVersion();
print "$version<br />\n";

// Add a meeting.
$meeting = $bbb->server->addMeeting([
    'id' => '123-456-789-000',
    'attendeePW' => 'Guphei4i',
    'moderatorPW' => 'ioy9Xep9',
    'name' => 'A BigBlueButton meeting',
    'welcome' => 'Welcome to %%CONFNAME%%.',
    'logoutURL' => 'https://example.org/',
    'record' => true,
    'autoStartRecording' => true,
    'meta'  => [
        'bn-recording-ready-url' => urlencode('https://example.com/api/v1/recording_status'),
        'presenter' => 'John Smith',
    ],
    //any other parameters from [BBB API Documentation](https://docs.bigbluebutton.org/dev/api.html#create)
]);
print '<pre>' . print_r($meeting, true) . "</pre>\n\n";

// Get meeting join URL for a moderator.
$full_name = 'Martin Moderator';
$url = $meeting->join($full_name, true);
print "Hi $full_name, you are a moderator. Please join the call via $url<br />\n\n";

// Get meeting join URL for an attendee:
$full_name = 'Anton Attendee';
$url = $meeting->join($full_name);
print "Hi $full_name, you are an attendee. Please join the call via $url<br />\n\n";

Bigbluebutton Secret and URI discovery

bbb-conf --secret

Tests

export BBB_URI=http://example.org/bigbluebutton/
export BBB_SECRET=aiShaiteih6nahchieq1quaiyul8ce4Zu
export BBB_ENDPOINT=api/
./vendor/bin/phpunit

License

GNU GENERAL PUBLIC LICENSE Version 3 and later

php-bigbluebutton's People

Contributors

brullworfel avatar sanduhrs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

php-bigbluebutton's Issues

Pe-upload slides

I can't run pre-upload slides. I tried this code but it doesn't work.

$meeting['slides'][] = new Document('http://test.com/files/docs/8/2/1599341207.pdf', 'test.pdf');

Can't pass metadata: $bbb->server->addMeeting doesn't accept meta

I wanted to create an End meeting callback URL. Included 'meta_endCallbackUrl' key with value being my application callback url in $bbb->server->addMeeting, but it wasn't sent to my BBB server.

I had to hardcode the meta in the create() method of the Meeting class to make it work:

$response = $this->client->get('create', [

I just added a line in the array like this:
'meta_endCallbackUrl' => 'https://my_domain.xyz/my_callback?meeting_id='.$this->getMeetingID()
Now it's working as expected.

Would be nice if you could fix this issue.
Thanks.

Need help how to add presentation data on Creat meeting

Hi,

i am fresher and implemented basic integration.
I was change slide and presentation in run time.

I have gone through the meeting class seen there is addSlides(Document $document).
Sorry i am fresher but unable getting how pass data for document.
Can any one help to provide some sample code to add document while creating the meeting.

thanks.. in Advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.