A simple server that uses the Vonage PHP Video SDK to create Vonage Video API sessions and generate tokens for those sessions, using Vonage API credentials (a Vonage application ID and private key).
-
Clone the app by running the command
git clone git@github.com:vonage-community/sample-video-php-learning_server.git
-
cd
to the root directory. -
Run
composer install
command to fetch and install all dependencies. -
Next, copy the
.env.dist
file to.env
and edit to add your Vonage application ID and the path to the private key file for that application:API_APPLICATION_ID=824e6a17-7830-4343-8b97-2b72f9d09cdc PRIVATE_KEY="/Users/bob/path-to-key/your-private-key.key" ENABLE_LOGGING=false LOGGING_PATH='/Users/bob/path-to-the-log-files-directory'
-
Start the server using composer:
`$ composer run --timeout 0 serve`
-
Visit the URL http://localhost:3000/room/roomName in your browser. (Replace
roomName
with a unique room name. You should see a JSON response containing the OpenTok API key, session ID, and token. -
Visit the URL http://localhost:3000/room/roomName/join in your browser. You should see a page with a test Video API session with a Video API publisher video. Open the page in another browser. You should see a page with a publisher and subscriber video.
-
Click the Start Archive button to start recording the session.
-
Click the Stop Archive button to stop recording the session.
-
Click the View archive info button to view details about the archive.
-
Click the View archive button to view the archive recording.
-
Click the Send signal from server button to have the server send a signal to the session.
-