Skip to content

Package: jitsi

Generated from api/packages/jitsi

Source: api/packages/jitsi · imported version 0.1.2. The sections after the README are extracted from the code on every docs build.

Jitsi integration

This package introduce just a facade that you can use to generate parameters for jitsi player

  • composer require ulams/jitsi
  • Setup environmental config to point to Jitsi service - use either env file or Settings package (settings should be visible in the settings endpoint)
return [
'host' => env('JITSI_HOST', 'meet-stage.ulams.app'),
'app_id' => env('JITSI_APP_ID', 'meet-id'),
'secret' => env('JITSI_APP_SECRET', 'secret'),
'package_status' => 'enabled',
];

If app_id or secret service will skip JWT token generation.

Once you provide the above you can generate parameters, example from tinker

\Ulams\Jitsi\Facades\Jitsi::getChannelData(App\Models\User::find(1), "czesc ziomku", true, ['logoImageUrl'=>'https://ulams.pl/_next/image?url=%2Fimages%2Flogo-ulams.svg&w=3840&q=75'])

would generate some thing like

[
"data" => [
"domain" => "meet-stage.ulams.app",
"roomName" => "czescZiomku",
"configOverwrite" => [
"logoImageUrl" => "https://ulams.pl/_next/image?url=%2Fimages%2Flogo-ulams.svg&w=3840&q=75",
],
"interfaceConfigOverwrite" => [
],
"userInfo" => [
"id" => 1,
"name" => "Osman Kanu",
"displayName" => "Osman Kanu",
"email" => "student@ulams.com",
"moderator" => true,
],
"jwt" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtZWV0LWlkIiwiYXVkIjoibWVldC1pZCIsInN1YiI6Im1lZXQtc3RhZ2UuZXNjb2xhbG1zLmNvbSIsImV4cCI6MTY0MzY1OTM1NCwicm9vbSI6ImN6ZXNjWmlvbWt1IiwidXNlciI6eyJpZCI6MSwibmFtZSI6Ik9zbWFuIEthbnUiLCJkaXNwbGF5TmFtZSI6Ik9zbWFuIEthbnUiLCJlbWFpbCI6InN0dWRlbnRAZXNjb2xhLWxtcy5jb20iLCJtb2RlcmF0b3IiOmZhbHNlfX0.xnFV-Kk63c3YRADzkSQLz6FP71yfEUO7Q53isFGkv_U",
],
"host" => "meet-stage.ulams.app",
"url" => "https://meet-stage.ulams.app/czescZiomku?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtZWV0LWlkIiwiYXVkIjoibWVldC1pZCIsInN1YiI6Im1lZXQtc3RhZ2UuZXNjb2xhbG1zLmNvbSIsImV4cCI6MTY0MzY1OTM1NCwicm9vbSI6ImN6ZXNjWmlvbWt1IiwidXNlciI6eyJpZCI6MSwibmFtZSI6Ik9zbWFuIEthbnUiLCJkaXNwbGF5TmFtZSI6Ik9zbWFuIEthbnUiLCJlbWFpbCI6InN0dWRlbnRAZXNjb2xhLWxtcy5jb20iLCJtb2RlcmF0b3IiOmZhbHNlfX0.xnFV-Kk63c3YRADzkSQLz6FP71yfEUO7Q53isFGkv_U",
]

pass this object into endpoint that generates jitsi call. You should definitely read the manual before.

Example

import React from "react";
import JitsiMeeting from "@jitsi/web-sdk/lib/components/JitsiMeeting";
import type {
IJitsiMeetExternalApi,
IJitsiMeetingProps,
} from "@jitsi/web-sdk/lib/types";
const dataFromEndpoint = {
domain: "meet-stage.ulams.app",
roomName: "czescZiomku",
configOverwrite: {},
interfaceConfigOverwrite: {},
userInfo: {
displayName: "Osman Kanu",
email: "student@ulams.com",
},
jwt: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtZWV0LWlkIiwiYXVkIjoibWVldC1pZCIsInN1YiI6Im1lZXQtc3RhZ2UuZXNjb2xhbG1zLmNvbSIsImV4cCI6MTY0MzY1OTM1NCwicm9vbSI6ImN6ZXNjWmlvbWt1IiwidXNlciI6eyJpZCI6MSwibmFtZSI6Ik9zbWFuIEthbnUiLCJkaXNwbGF5TmFtZSI6Ik9zbWFuIEthbnUiLCJlbWFpbCI6InN0dWRlbnRAZXNjb2xhLWxtcy5jb20iLCJtb2RlcmF0b3IiOmZhbHNlfX0.xnFV-Kk63c3YRADzkSQLz6FP71yfEUO7Q53isFGkv_U",
};
const data: IJitsiMeetingProps = {
...dataFromEndpoint,
onApiReady: (api) => console.log("api ready", api),
};
function App() {
return (
<div className="App">
<JitsiMeeting {...data} />
</div>
);
}
export default App;

Run ./vendor/bin/phpunit --filter 'Ulams\\Jitsi\\Tests' to run tests. See tests folder as it’s quite good staring point as documentation appendix.

Method Path Auth Action
POST /api/jitsi/recorded-video JitsiApiController@recordedVideo

None.

Registered with AdministrableConfig::registerConfig (editable in the admin panel under Configuration → Settings).

Key Rules Public Read-only
jitsi.package_status nullable, string, in: . implode(,, PackageStatusEnum::getValues()) no
jitsi.jitsi_host nullable, string yes
jitsi.app_id nullable, string no
jitsi.secret nullable, string no
jitsi.jaas_host nullable, string yes
jitsi.aud nullable, string no
jitsi.iss nullable, string no
jitsi.kid nullable, string no
jitsi.private_key nullable, string no
jitsi.sub nullable, string, false yes
jitsi.recording nullable, boolean, false yes

None.

None.

None.

JAAS_AUD, JAAS_HOST, JAAS_ISS, JAAS_KEY_ID, JAAS_PRIVATE_KEY, JAAS_RECORDING, JAAS_SUB, JITSI_APP_ID, JITSI_APP_SECRET, JITSI_HOST, JITSI_RECORDING_DOWNLOAD_TIMEOUT, JITSI_RECORDING_HOSTS, JITSI_RECORDING_MAX_BYTES, JITSI_WEBHOOK_SECRET, JITSI_WEBHOOK_TOKEN, JITSI_WEBHOOK_TOLERANCE