alternative to flash shared objects

Gabriel T

Member
hello
im redesigning my web conference app, previsouly working with flash, with webrtc and websockets. while all real time communication is fine, i'm struggling on how to find an alternative to flash shared objects to store datas such as room state etc on the server. so far i'm doing it with ratchet socket server, but i still didnt find a way to reset room datas automatically when conference is finished (like wowza application instances dying by themselves when room is empty , then flushing all datas stored in shared objects)
does anybody has some ideas/recommandations to handle this problem ?

thank you for your help and suggestions
 

Max

Administrator
Staff member
Hello

1. WCS sends REST hooks on each user event (i.e. connection, disconnection, play stream, start stream, etc).
2. WCS allows to send arbitrary json data to REST hooks. So you can send an object {"name":"value"} and receive this object as REST hook on server side.
3. And finally WCS can deliver arbitrary json data object to connected browser using direct REST URL https://host:8888/rest-api/data/send {...}

Therefore you can implement a kind of shared objects but you need server-side programming for that.
Example:
1. User A sends arbitrary data
Code:
session.sendData({operationId:'123',payload:{name:"value"}});
2. WCS sends REST hook /OnDataEvent {name:"value"}
3. Back-end sends REST request https://host:8888/rest-api/data/send {sessionId:'user-b-session-id',payload:{name:"value"}};
4. User B receives the data {name:"value"} in Session.ON_DATA event.

Here you can find REST docs:
Hooks
https://flashphoner.com/docs/wcs5/wcs_docs/html/en/wcs-rest-methods/
Direct REST API
https://flashphoner.com/docs/wcs5/wcs_docs/html/en/wcs-rest-api/

Here you can find working implementation
https://wcs5-eu.flashphoner.com/client2/examples/demo/streaming/conference/conference.html
https://wcs5-eu.flashphoner.com/client2/examples/demo/streaming/conference/conference.js
This app uses room sub-API
https://github.com/flashphoner/flashphoner_client/blob/wcs_api-2.0/src/room-module.js
As you can see it uses session.sendData() method.
https://github.com/flashphoner/flashphoner_client/blob/wcs_api-2.0/src/room-module.js#L477
So it looks like shared objects. You have a room and you can broadcast messages within the room.
 
Top