133 |
134 |
135 |
--------------------------------------------------------------------------------
/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Session Lifetime
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may specify the number of minutes that you wish the session
29 | | to be allowed to remain idle before it expires. If you want them
30 | | to immediately expire on the browser closing, set that option.
31 | |
32 | */
33 |
34 | 'lifetime' => env('SESSION_LIFETIME', 120),
35 |
36 | 'expire_on_close' => false,
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Session Encryption
41 | |--------------------------------------------------------------------------
42 | |
43 | | This option allows you to easily specify that all of your session data
44 | | should be encrypted before it is stored. All encryption will be run
45 | | automatically by Laravel and you can use the Session like normal.
46 | |
47 | */
48 |
49 | 'encrypt' => false,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Session File Location
54 | |--------------------------------------------------------------------------
55 | |
56 | | When using the native session driver, we need a location where session
57 | | files may be stored. A default has been set for you but a different
58 | | location may be specified. This is only needed for file sessions.
59 | |
60 | */
61 |
62 | 'files' => storage_path('framework/sessions'),
63 |
64 | /*
65 | |--------------------------------------------------------------------------
66 | | Session Database Connection
67 | |--------------------------------------------------------------------------
68 | |
69 | | When using the "database" or "redis" session drivers, you may specify a
70 | | connection that should be used to manage these sessions. This should
71 | | correspond to a connection in your database configuration options.
72 | |
73 | */
74 |
75 | 'connection' => env('SESSION_CONNECTION'),
76 |
77 | /*
78 | |--------------------------------------------------------------------------
79 | | Session Database Table
80 | |--------------------------------------------------------------------------
81 | |
82 | | When using the "database" session driver, you may specify the table we
83 | | should use to manage the sessions. Of course, a sensible default is
84 | | provided for you; however, you are free to change this as needed.
85 | |
86 | */
87 |
88 | 'table' => 'sessions',
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Session Cache Store
93 | |--------------------------------------------------------------------------
94 | |
95 | | While using one of the framework's cache driven session backends you may
96 | | list a cache store that should be used for these sessions. This value
97 | | must match with one of the application's configured cache "stores".
98 | |
99 | | Affects: "apc", "dynamodb", "memcached", "redis"
100 | |
101 | */
102 |
103 | 'store' => env('SESSION_STORE'),
104 |
105 | /*
106 | |--------------------------------------------------------------------------
107 | | Session Sweeping Lottery
108 | |--------------------------------------------------------------------------
109 | |
110 | | Some session drivers must manually sweep their storage location to get
111 | | rid of old sessions from storage. Here are the chances that it will
112 | | happen on a given request. By default, the odds are 2 out of 100.
113 | |
114 | */
115 |
116 | 'lottery' => [2, 100],
117 |
118 | /*
119 | |--------------------------------------------------------------------------
120 | | Session Cookie Name
121 | |--------------------------------------------------------------------------
122 | |
123 | | Here you may change the name of the cookie used to identify a session
124 | | instance by ID. The name specified here will get used every time a
125 | | new session cookie is created by the framework for every driver.
126 | |
127 | */
128 |
129 | 'cookie' => env(
130 | 'SESSION_COOKIE',
131 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
132 | ),
133 |
134 | /*
135 | |--------------------------------------------------------------------------
136 | | Session Cookie Path
137 | |--------------------------------------------------------------------------
138 | |
139 | | The session cookie path determines the path for which the cookie will
140 | | be regarded as available. Typically, this will be the root path of
141 | | your application but you are free to change this when necessary.
142 | |
143 | */
144 |
145 | 'path' => '/',
146 |
147 | /*
148 | |--------------------------------------------------------------------------
149 | | Session Cookie Domain
150 | |--------------------------------------------------------------------------
151 | |
152 | | Here you may change the domain of the cookie used to identify a session
153 | | in your application. This will determine which domains the cookie is
154 | | available to in your application. A sensible default has been set.
155 | |
156 | */
157 |
158 | 'domain' => env('SESSION_DOMAIN'),
159 |
160 | /*
161 | |--------------------------------------------------------------------------
162 | | HTTPS Only Cookies
163 | |--------------------------------------------------------------------------
164 | |
165 | | By setting this option to true, session cookies will only be sent back
166 | | to the server if the browser has a HTTPS connection. This will keep
167 | | the cookie from being sent to you when it can't be done securely.
168 | |
169 | */
170 |
171 | 'secure' => env('SESSION_SECURE_COOKIE'),
172 |
173 | /*
174 | |--------------------------------------------------------------------------
175 | | HTTP Access Only
176 | |--------------------------------------------------------------------------
177 | |
178 | | Setting this value to true will prevent JavaScript from accessing the
179 | | value of the cookie and the cookie will only be accessible through
180 | | the HTTP protocol. You are free to modify this option if needed.
181 | |
182 | */
183 |
184 | 'http_only' => true,
185 |
186 | /*
187 | |--------------------------------------------------------------------------
188 | | Same-Site Cookies
189 | |--------------------------------------------------------------------------
190 | |
191 | | This option determines how your cookies behave when cross-site requests
192 | | take place, and can be used to mitigate CSRF attacks. By default, we
193 | | will set this value to "lax" since this is a secure default value.
194 | |
195 | | Supported: "lax", "strict", "none", null
196 | |
197 | */
198 |
199 | 'same_site' => 'lax',
200 |
201 | ];
202 |
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_NAME', 'Laravel'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Application Environment
23 | |--------------------------------------------------------------------------
24 | |
25 | | This value determines the "environment" your application is currently
26 | | running in. This may determine how you prefer to configure various
27 | | services the application utilizes. Set this in your ".env" file.
28 | |
29 | */
30 |
31 | 'env' => env('APP_ENV', 'production'),
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Application Debug Mode
36 | |--------------------------------------------------------------------------
37 | |
38 | | When your application is in debug mode, detailed error messages with
39 | | stack traces will be shown on every error that occurs within your
40 | | application. If disabled, a simple generic error page is shown.
41 | |
42 | */
43 |
44 | 'debug' => (bool) env('APP_DEBUG', false),
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Application URL
49 | |--------------------------------------------------------------------------
50 | |
51 | | This URL is used by the console to properly generate URLs when using
52 | | the Artisan command line tool. You should set this to the root of
53 | | your application so that it is used when running Artisan tasks.
54 | |
55 | */
56 |
57 | 'url' => env('APP_URL', 'http://localhost'),
58 |
59 | 'asset_url' => env('ASSET_URL'),
60 |
61 | /*
62 | |--------------------------------------------------------------------------
63 | | Application Timezone
64 | |--------------------------------------------------------------------------
65 | |
66 | | Here you may specify the default timezone for your application, which
67 | | will be used by the PHP date and date-time functions. We have gone
68 | | ahead and set this to a sensible default for you out of the box.
69 | |
70 | */
71 |
72 | 'timezone' => 'UTC',
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Application Locale Configuration
77 | |--------------------------------------------------------------------------
78 | |
79 | | The application locale determines the default locale that will be used
80 | | by the translation service provider. You are free to set this value
81 | | to any of the locales which will be supported by the application.
82 | |
83 | */
84 |
85 | 'locale' => 'en',
86 |
87 | /*
88 | |--------------------------------------------------------------------------
89 | | Application Fallback Locale
90 | |--------------------------------------------------------------------------
91 | |
92 | | The fallback locale determines the locale to use when the current one
93 | | is not available. You may change the value to correspond to any of
94 | | the language folders that are provided through your application.
95 | |
96 | */
97 |
98 | 'fallback_locale' => 'en',
99 |
100 | /*
101 | |--------------------------------------------------------------------------
102 | | Faker Locale
103 | |--------------------------------------------------------------------------
104 | |
105 | | This locale will be used by the Faker PHP library when generating fake
106 | | data for your database seeds. For example, this will be used to get
107 | | localized telephone numbers, street address information and more.
108 | |
109 | */
110 |
111 | 'faker_locale' => 'en_US',
112 |
113 | /*
114 | |--------------------------------------------------------------------------
115 | | Encryption Key
116 | |--------------------------------------------------------------------------
117 | |
118 | | This key is used by the Illuminate encrypter service and should be set
119 | | to a random, 32 character string, otherwise these encrypted strings
120 | | will not be safe. Please do this before deploying an application!
121 | |
122 | */
123 |
124 | 'key' => env('APP_KEY'),
125 |
126 | 'cipher' => 'AES-256-CBC',
127 |
128 | /*
129 | |--------------------------------------------------------------------------
130 | | Maintenance Mode Driver
131 | |--------------------------------------------------------------------------
132 | |
133 | | These configuration options determine the driver used to determine and
134 | | manage Laravel's "maintenance mode" status. The "cache" driver will
135 | | allow maintenance mode to be controlled across multiple machines.
136 | |
137 | | Supported drivers: "file", "cache"
138 | |
139 | */
140 |
141 | 'maintenance' => [
142 | 'driver' => 'file',
143 | // 'store' => 'redis',
144 | ],
145 |
146 | /*
147 | |--------------------------------------------------------------------------
148 | | Autoloaded Service Providers
149 | |--------------------------------------------------------------------------
150 | |
151 | | The service providers listed here will be automatically loaded on the
152 | | request to your application. Feel free to add your own services to
153 | | this array to grant expanded functionality to your applications.
154 | |
155 | */
156 |
157 | 'providers' => [
158 |
159 | /*
160 | * Laravel Framework Service Providers...
161 | */
162 | Illuminate\Auth\AuthServiceProvider::class,
163 | Illuminate\Broadcasting\BroadcastServiceProvider::class,
164 | Illuminate\Bus\BusServiceProvider::class,
165 | Illuminate\Cache\CacheServiceProvider::class,
166 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
167 | Illuminate\Cookie\CookieServiceProvider::class,
168 | Illuminate\Database\DatabaseServiceProvider::class,
169 | Illuminate\Encryption\EncryptionServiceProvider::class,
170 | Illuminate\Filesystem\FilesystemServiceProvider::class,
171 | Illuminate\Foundation\Providers\FoundationServiceProvider::class,
172 | Illuminate\Hashing\HashServiceProvider::class,
173 | Illuminate\Mail\MailServiceProvider::class,
174 | Illuminate\Notifications\NotificationServiceProvider::class,
175 | Illuminate\Pagination\PaginationServiceProvider::class,
176 | Illuminate\Pipeline\PipelineServiceProvider::class,
177 | Illuminate\Queue\QueueServiceProvider::class,
178 | Illuminate\Redis\RedisServiceProvider::class,
179 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
180 | Illuminate\Session\SessionServiceProvider::class,
181 | Illuminate\Translation\TranslationServiceProvider::class,
182 | Illuminate\Validation\ValidationServiceProvider::class,
183 | Illuminate\View\ViewServiceProvider::class,
184 |
185 | /*
186 | * Package Service Providers...
187 | */
188 |
189 | /*
190 | * Application Service Providers...
191 | */
192 | App\Providers\AppServiceProvider::class,
193 | App\Providers\AuthServiceProvider::class,
194 | // App\Providers\BroadcastServiceProvider::class,
195 | App\Providers\EventServiceProvider::class,
196 | App\Providers\RouteServiceProvider::class,
197 |
198 | ],
199 |
200 | /*
201 | |--------------------------------------------------------------------------
202 | | Class Aliases
203 | |--------------------------------------------------------------------------
204 | |
205 | | This array of class aliases will be registered when this application
206 | | is started. However, feel free to register as many as you wish as
207 | | the aliases are "lazy" loaded so they don't hinder performance.
208 | |
209 | */
210 |
211 | 'aliases' => Facade::defaultAliases()->merge([
212 | // 'ExampleClass' => App\Example\ExampleClass::class,
213 | ])->toArray(),
214 |
215 | ];
216 |
--------------------------------------------------------------------------------
/lang/en/validation.php:
--------------------------------------------------------------------------------
1 | 'The :attribute must be accepted.',
17 | 'accepted_if' => 'The :attribute must be accepted when :other is :value.',
18 | 'active_url' => 'The :attribute is not a valid URL.',
19 | 'after' => 'The :attribute must be a date after :date.',
20 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
21 | 'alpha' => 'The :attribute must only contain letters.',
22 | 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',
23 | 'alpha_num' => 'The :attribute must only contain letters and numbers.',
24 | 'array' => 'The :attribute must be an array.',
25 | 'before' => 'The :attribute must be a date before :date.',
26 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
27 | 'between' => [
28 | 'array' => 'The :attribute must have between :min and :max items.',
29 | 'file' => 'The :attribute must be between :min and :max kilobytes.',
30 | 'numeric' => 'The :attribute must be between :min and :max.',
31 | 'string' => 'The :attribute must be between :min and :max characters.',
32 | ],
33 | 'boolean' => 'The :attribute field must be true or false.',
34 | 'confirmed' => 'The :attribute confirmation does not match.',
35 | 'current_password' => 'The password is incorrect.',
36 | 'date' => 'The :attribute is not a valid date.',
37 | 'date_equals' => 'The :attribute must be a date equal to :date.',
38 | 'date_format' => 'The :attribute does not match the format :format.',
39 | 'declined' => 'The :attribute must be declined.',
40 | 'declined_if' => 'The :attribute must be declined when :other is :value.',
41 | 'different' => 'The :attribute and :other must be different.',
42 | 'digits' => 'The :attribute must be :digits digits.',
43 | 'digits_between' => 'The :attribute must be between :min and :max digits.',
44 | 'dimensions' => 'The :attribute has invalid image dimensions.',
45 | 'distinct' => 'The :attribute field has a duplicate value.',
46 | 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.',
47 | 'email' => 'The :attribute must be a valid email address.',
48 | 'ends_with' => 'The :attribute must end with one of the following: :values.',
49 | 'enum' => 'The selected :attribute is invalid.',
50 | 'exists' => 'The selected :attribute is invalid.',
51 | 'file' => 'The :attribute must be a file.',
52 | 'filled' => 'The :attribute field must have a value.',
53 | 'gt' => [
54 | 'array' => 'The :attribute must have more than :value items.',
55 | 'file' => 'The :attribute must be greater than :value kilobytes.',
56 | 'numeric' => 'The :attribute must be greater than :value.',
57 | 'string' => 'The :attribute must be greater than :value characters.',
58 | ],
59 | 'gte' => [
60 | 'array' => 'The :attribute must have :value items or more.',
61 | 'file' => 'The :attribute must be greater than or equal to :value kilobytes.',
62 | 'numeric' => 'The :attribute must be greater than or equal to :value.',
63 | 'string' => 'The :attribute must be greater than or equal to :value characters.',
64 | ],
65 | 'image' => 'The :attribute must be an image.',
66 | 'in' => 'The selected :attribute is invalid.',
67 | 'in_array' => 'The :attribute field does not exist in :other.',
68 | 'integer' => 'The :attribute must be an integer.',
69 | 'ip' => 'The :attribute must be a valid IP address.',
70 | 'ipv4' => 'The :attribute must be a valid IPv4 address.',
71 | 'ipv6' => 'The :attribute must be a valid IPv6 address.',
72 | 'json' => 'The :attribute must be a valid JSON string.',
73 | 'lt' => [
74 | 'array' => 'The :attribute must have less than :value items.',
75 | 'file' => 'The :attribute must be less than :value kilobytes.',
76 | 'numeric' => 'The :attribute must be less than :value.',
77 | 'string' => 'The :attribute must be less than :value characters.',
78 | ],
79 | 'lte' => [
80 | 'array' => 'The :attribute must not have more than :value items.',
81 | 'file' => 'The :attribute must be less than or equal to :value kilobytes.',
82 | 'numeric' => 'The :attribute must be less than or equal to :value.',
83 | 'string' => 'The :attribute must be less than or equal to :value characters.',
84 | ],
85 | 'mac_address' => 'The :attribute must be a valid MAC address.',
86 | 'max' => [
87 | 'array' => 'The :attribute must not have more than :max items.',
88 | 'file' => 'The :attribute must not be greater than :max kilobytes.',
89 | 'numeric' => 'The :attribute must not be greater than :max.',
90 | 'string' => 'The :attribute must not be greater than :max characters.',
91 | ],
92 | 'mimes' => 'The :attribute must be a file of type: :values.',
93 | 'mimetypes' => 'The :attribute must be a file of type: :values.',
94 | 'min' => [
95 | 'array' => 'The :attribute must have at least :min items.',
96 | 'file' => 'The :attribute must be at least :min kilobytes.',
97 | 'numeric' => 'The :attribute must be at least :min.',
98 | 'string' => 'The :attribute must be at least :min characters.',
99 | ],
100 | 'multiple_of' => 'The :attribute must be a multiple of :value.',
101 | 'not_in' => 'The selected :attribute is invalid.',
102 | 'not_regex' => 'The :attribute format is invalid.',
103 | 'numeric' => 'The :attribute must be a number.',
104 | 'password' => [
105 | 'letters' => 'The :attribute must contain at least one letter.',
106 | 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.',
107 | 'numbers' => 'The :attribute must contain at least one number.',
108 | 'symbols' => 'The :attribute must contain at least one symbol.',
109 | 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.',
110 | ],
111 | 'present' => 'The :attribute field must be present.',
112 | 'prohibited' => 'The :attribute field is prohibited.',
113 | 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
114 | 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
115 | 'prohibits' => 'The :attribute field prohibits :other from being present.',
116 | 'regex' => 'The :attribute format is invalid.',
117 | 'required' => 'The :attribute field is required.',
118 | 'required_array_keys' => 'The :attribute field must contain entries for: :values.',
119 | 'required_if' => 'The :attribute field is required when :other is :value.',
120 | 'required_unless' => 'The :attribute field is required unless :other is in :values.',
121 | 'required_with' => 'The :attribute field is required when :values is present.',
122 | 'required_with_all' => 'The :attribute field is required when :values are present.',
123 | 'required_without' => 'The :attribute field is required when :values is not present.',
124 | 'required_without_all' => 'The :attribute field is required when none of :values are present.',
125 | 'same' => 'The :attribute and :other must match.',
126 | 'size' => [
127 | 'array' => 'The :attribute must contain :size items.',
128 | 'file' => 'The :attribute must be :size kilobytes.',
129 | 'numeric' => 'The :attribute must be :size.',
130 | 'string' => 'The :attribute must be :size characters.',
131 | ],
132 | 'starts_with' => 'The :attribute must start with one of the following: :values.',
133 | 'string' => 'The :attribute must be a string.',
134 | 'timezone' => 'The :attribute must be a valid timezone.',
135 | 'unique' => 'The :attribute has already been taken.',
136 | 'uploaded' => 'The :attribute failed to upload.',
137 | 'url' => 'The :attribute must be a valid URL.',
138 | 'uuid' => 'The :attribute must be a valid UUID.',
139 |
140 | /*
141 | |--------------------------------------------------------------------------
142 | | Custom Validation Language Lines
143 | |--------------------------------------------------------------------------
144 | |
145 | | Here you may specify custom validation messages for attributes using the
146 | | convention "attribute.rule" to name the lines. This makes it quick to
147 | | specify a specific custom language line for a given attribute rule.
148 | |
149 | */
150 |
151 | 'custom' => [
152 | 'attribute-name' => [
153 | 'rule-name' => 'custom-message',
154 | ],
155 | ],
156 |
157 | /*
158 | |--------------------------------------------------------------------------
159 | | Custom Validation Attributes
160 | |--------------------------------------------------------------------------
161 | |
162 | | The following language lines are used to swap our attribute placeholder
163 | | with something more reader friendly such as "E-Mail Address" instead
164 | | of "email". This simply helps us make our message more expressive.
165 | |
166 | */
167 |
168 | 'attributes' => [],
169 |
170 | ];
171 |
--------------------------------------------------------------------------------
/resources/js/app.js:
--------------------------------------------------------------------------------
1 | import './bootstrap';
2 | import jquery from 'jquery';
3 |
4 | let meetingJoined = false;
5 | const meeting = new Metered.Meeting();
6 | let cameraOn = false;
7 | let micOn = false;
8 | let screenSharingOn = false;
9 | let localVideoStream = null;
10 | let activeSpeakerId = null;
11 | let meetingInfo = {};
12 |
13 | async function initializeView() {
14 | /**
15 | * Populating the cameras
16 | */
17 | const videoInputDevices = await meeting.listVideoInputDevices();
18 | const videoOptions = [];
19 | for (let item of videoInputDevices) {
20 | videoOptions.push(
21 | ``
22 | )
23 | }
24 | jquery("#cameraSelectBox").html(videoOptions.join(""));
25 |
26 | /**
27 | * Populating Microphones
28 | */
29 | const audioInputDevices = await meeting.listAudioInputDevices();
30 | const audioOptions = [];
31 | for (let item of audioInputDevices) {
32 | audioOptions.push(
33 | ``
34 | )
35 | }
36 | jquery("#microphoneSelectBox").html(audioOptions.join(""));
37 |
38 |
39 | /**
40 | * Mute/Unmute Camera and Microphone
41 | */
42 | jquery("#waitingAreaToggleMicrophone").on("click", function() {
43 | if (micOn) {
44 | micOn = false;
45 | jquery("#waitingAreaToggleMicrophone").removeClass("bg-gray-500");
46 | jquery("#waitingAreaToggleMicrophone").addClass("bg-gray-400");
47 | } else {
48 | micOn = true;
49 | jquery("#waitingAreaToggleMicrophone").removeClass("bg-gray-400");
50 | jquery("#waitingAreaToggleMicrophone").addClass("bg-gray-500");
51 | }
52 | });
53 |
54 | jquery("#waitingAreaToggleCamera").on("click", async function() {
55 | if (cameraOn) {
56 | cameraOn = false;
57 | jquery("#waitingAreaToggleCamera").removeClass("bg-gray-500");
58 | jquery("#waitingAreaToggleCamera").addClass("bg-gray-400");
59 | const tracks = localVideoStream.getTracks();
60 | tracks.forEach(function (track) {
61 | track.stop();
62 | });
63 | localVideoStream = null;
64 | jquery("#waitingAreaLocalVideo")[0].srcObject = null;
65 | } else {
66 | cameraOn = true;
67 | jquery("#waitingAreaToggleCamera").removeClass("bg-gray-400");
68 | jquery("#waitingAreaToggleCamera").addClass("bg-gray-500");
69 | localVideoStream = await meeting.getLocalVideoStream();
70 | jquery("#waitingAreaLocalVideo")[0].srcObject = localVideoStream;
71 | cameraOn = true;
72 | }
73 | });
74 |
75 | /**
76 | * Adding Event Handlers
77 | */
78 | jquery("#cameraSelectBox").on("change", async function() {
79 | const deviceId = jquery("#cameraSelectBox").val();
80 | await meeting.chooseVideoInputDevice(deviceId);
81 | if (cameraOn) {
82 | localVideoStream = await meeting.getLocalVideoStream();
83 | jquery("#waitingAreaLocalVideo")[0].srcObject = localVideoStream;
84 | }
85 | });
86 |
87 | jquery("#microphoneSelectBox").on("change", async function() {
88 | const deviceId = jquery("#microphoneSelectBox").val();
89 | await meeting.chooseAudioInputDevice(deviceId);
90 | });
91 |
92 | }
93 | initializeView();
94 |
95 | jquery("#joinMeetingBtn").on("click", async function () {
96 | var username = jquery("#username").val();
97 | if (!username) {
98 | return alert("Please enter a username");
99 | }
100 |
101 | try {
102 | meetingInfo = await meeting.join({
103 | roomURL: `${window.METERED_DOMAIN}/${window.MEETING_ID}`,
104 | name: username,
105 | });
106 |
107 | console.log("Meeting joined", meetingInfo);
108 | jquery("#waitingArea").addClass("hidden");
109 | jquery("#meetingView").removeClass("hidden");
110 | jquery("#meetingAreaUsername").text(username);
111 |
112 | /**
113 | * If camera button is clicked on the meeting view
114 | * then sharing the camera after joining the meeting.
115 | */
116 | if (cameraOn) {
117 | await meeting.startVideo();
118 | jquery("#localVideoTag")[0].srcObject = localVideoStream;
119 | jquery("#localVideoTag")[0].play();
120 | jquery("#toggleCamera").removeClass("bg-gray-400");
121 | jquery("#toggleCamera").addClass("bg-gray-500");
122 | }
123 |
124 | /**
125 | * Microphone button is clicked on the meeting view then
126 | * sharing the microphone after joining the meeting
127 | */
128 | if (micOn) {
129 | jquery("#toggleMicrophone").removeClass("bg-gray-400");
130 | jquery("#toggleMicrophone").addClass("bg-gray-500");
131 | await meeting.startAudio();
132 | }
133 |
134 | } catch (ex) {
135 | console.log("Error occurred when joining the meeting", ex);
136 | }
137 | });
138 |
139 | /**
140 | * Handling Events
141 | */
142 | meeting.on("onlineParticipants", function(participants) {
143 |
144 | for (let participantInfo of participants) {
145 | if (!jquery(`#participant-${participantInfo._id}`)[0] && participantInfo._id !== meeting.participantInfo._id) {
146 | jquery("#remoteParticipantContainer").append(
147 | `
148 |