Keeping relevant data in daily prebuilt room when the owner leaves and comes back to the room.
We are building video call application between a teacher and students using daily-js.
We use daily prebuilt callFrame for teacher screen and custom callObject for student screen. We share the data between teacher and students using app-message for chat and reactions and setUserData() for important data like which student is on spotlight.
However, we anticipate a situation that teacher leaves the daily room (intentionally or accidentally). In such scenario, important data that we synced across users using setUserData() is lost from teacher.
There is a function to update the room data, but it is only accessible through callObject.
Is there any suggestion for best practice to handle this situation?
Thanks,
Tomo
Answers
-
Hi @TomohiroMaeda ,
Would sessionState be applicable for your use case? Here's a blog post overview:
It is settable both via the local client and also via the REST API:
This data persists at the session level, so it should be available even if the user that originally set state leaves the room. One caveat is that there is limited support for Daily Prebuilt, which may be an issue depending on your specific implementation.
1 -
Thanks!
We think we can figure out the way to sync all the data across user using the method you suggested.
1