eyeson-team / eyeson-php

eyeson video conferencing API package for PHP
MIT License
7 stars 11 forks source link

Problem creating persistent room with eyeson php! #38

Closed LuizGabrielEmporio closed 4 years ago

LuizGabrielEmporio commented 4 years ago

Good Morning. I'm still having trouble understanding how to create a persistent room with the api, I tried to pass the unique id in the function call to create the room, but I didn't get the result I expected. My project is being done in Laravel, next to the eyeson api through eyeson php. I would like you to send me a code example that passes this unique id so that I can have an idea of ​​how to integrate it into my project. Below is an example of the code I was testing to create the room:

$eyeson = new Eyeson($dadosEyeson['api_key']); $user = [ 'id' => $dadosUsuario['email'], 'name' => $dadosUsuario['nome'], 'avatar' => $dadosUsuario['foto'] ]; $room = $eyeson->join($user, $dados['nome']); $dados['link_reuniao'] = $room->getUrl();

opusonline commented 4 years ago

Good morning 😄

Everything looks good so far!

But what you're actually doing is, you're starting a meeting of the room with id $dados['nome']. The returned URL is pointing you to the GUI where you can join the running meeting immediately. If no one enters the meeting, it will automatically shutdown after a short period of time.

What makes the room persistent is just your room id $dados['nome']. There's no getURL function for a persistent room. You would have to create it on your application.

A user is creating a persistent room with your app (e.g. on https://portal.awesomeapp.com/) then your app creates a unique ID (for example a UUID) and can share the link (e.g. https://app.awesomeapp.com/room/12345). In a next step (probably some time later), a client clicks on the link to join the meeting and your API (in this case on app.awesomeapp.com) then starts the eyeson meeting with room ID 12345 and returns the generated meeting URL to the client (this is what your code above is doing).

Just for completeness, when the client - who clicks the link (https://app.awesomeapp.com/room/12345) - is already logged in to your app, you already have the $dadosUsuario. Otherwise you could use the $room->getGuestUrl() to let unregistered clients also attend the meeting. Or let them register on your app first, everything is possible, you decide 😉

Hope this helps!

Best regards, Stefan