Skip to content

Simple Spring Boot application to consume OpenVidu Server WebSocket RPC protocol to manage filters

License

Notifications You must be signed in to change notification settings

codeurjc/openvidu-server-filters-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openvidu-server-filters-client

Simple Spring Boot application to consume OpenVidu Server WebSocket RPC protocol to manage filters.

Running the application

  1. Run OpenVidu Server
docker run -p 4443:4443 --rm openvidu/openvidu-server-kms:2.11.0
  1. Run the application (change OPENVIDU_URL and OPENVIDU_SECRET to the proper values of your OpenVidu Server process)
git clone https://github.com/codeurjc/openvidu-server-filters-client.git
cd openvidu-server-filters-client
mvn -DOPENVIDU_URL=https://localhost:4443/ -DOPENVIDU_SECRET=MY_SECRET exec:java

Managing OpenVidu filters through the application

This SpringBoot applications offers a very simple REST API endpoint to call the 5 filters-related methods offered by OpenVidu Server (see OpenVidu Server RPC protocol).

By default it listens on port 8080 with no security at all, and the 5 REST operations are:

NOTE: file postman.json in the root path of this repository contains all 5 REST operations properly configured to be used with Postman client on localhost. Just import this json file inside Postman app and you will be ready to test all 5 REST methods on a running OpenVidu Session.


POST /apply-filter

Header: Content-Type: application/json

Body example

{
	"sessionId": "TestSession",
	"streamId": "exyoujh3l7wlhrru_CAMERA_SVTZP",
	"type": "GStreamerFilter",
    "options": "{\"command\": \"videobalance saturation=0.0\"}"
}

Response

  • 200: operation success
  • 400: some body parameter wrong
  • 500: error in OpenVidu Server. See the attached message for further information

POST /remove-filter

Header: Content-Type: application/json

Body example

{
	"sessionId": "TestSession",
	"streamId": "exyoujh3l7wlhrru_CAMERA_SVTZP"
}

Response

  • 200: operation success
  • 400: some body parameter wrong
  • 500: error in OpenVidu Server. See the attached message for further information

POST /exec-filter-method

Header: Content-Type: application/json

Body example

{
	"sessionId": "TestSession",
	"streamId": "exyoujh3l7wlhrru_CAMERA_SVTZP",
	"method": "setElementProperty",
	"params": "{\"propertyName\":\"saturation\",\"propertyValue\":\"1.0\"}"
}

Response

  • 200: operation success
  • 400: some body parameter wrong
  • 500: error in OpenVidu Server. See the attached message for further information

POST /add-filter-event-listener

Header: Content-Type: application/json

Body example

{
	"sessionId": "TestSession",
	"streamId": "exyoujh3l7wlhrru_CAMERA_SVTZP",
	"eventType": "CodeFound"
}

Response

  • 200: operation success
  • 400: some body parameter wrong
  • 500: error in OpenVidu Server. See the attached message for further information

POST /remove-filter-event-listener

Header: Content-Type: application/json

Body example

{
	"sessionId": "TestSession",
	"streamId": "exyoujh3l7wlhrru_CAMERA_SVTZP",
	"eventType": "CodeFound"
}

Response

  • 200: operation success
  • 400: some body parameter wrong
  • 500: error in OpenVidu Server. See the attached message for further information

About

Simple Spring Boot application to consume OpenVidu Server WebSocket RPC protocol to manage filters

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages