How to call Recordevents, Streamevents in insecure angular

17 views
Skip to first unread message

Prakash Burra

unread,
Jan 2, 2020, 12:20:03 PM1/2/20
to OpenVidu
Hello,

I am working with insecure angular, as per my requirement i used only Audio. I have some questions and queries for that. Please check below things and help me to how to integrate in angular project.

Recording Events:
1. recordingStarted
2.recordingStoped
How to use above methonds when recording started with REST API recordings/start. My question is when create first session, and join some participants, then publisher click on record api how to know others record started, for that above methods useful.

Stream Events:

Session Events:

How to use above methods as per our requirements. 
1. Network disconnection and reconnection
2. session closed by publisher

Actually my existing code like this when start or stop function in click event. but it will not work, Event no enter to console log.


this.session.on("recordingStarted", (eventRecordingEvent=> {
            console.log("recordingStarted")
});

this.session.on("recordingStoped", (eventRecordingEvent=> {
            console.log("recordingStoped")
});



Very helpful to if anyone provide with some sample angular code or git project.





Pablo

unread,
Jan 3, 2020, 4:33:04 AM1/3/20
to OpenVidu
Hi,

recordingStarted event will only be received by users that fulfill these 2 requirements:

1) Are connected to the session at the moment the recording starts
AND
2) Are included by property openvidu.recording.notification (which determines which users should receive recording notifications. See https://openvidu.io/docs/reference-docs/openvidu-server-params/)

For getting to know when some user has disconnected from a session (and their media stream has stopped, if they were publishing), you use connectionDestroyed (and streamDestroyed) events. Use reason property of these events to know why the user disconnected: https://openvidu.io/api/openvidu-browser/classes/connectionevent.html#reason

Regards.

Pablo

unread,
Jan 3, 2020, 5:40:48 AM1/3/20
to OpenVidu
Well, you can achieve this behavior by consulting the status of the Session in OpenVidu Server after any user connects to it. Let me clarify this a little bit futher:

On the one hand, you have available client events: these events are triggered in the browser or applications to let you quickly manage certain important situations in a Session, such as a participant connecting to it or a stream being published. You have all of them well described in openvidu-browser documentation: https://openvidu.io/api/openvidu-browser/classes/event.html. Two of these events are recording events (https://openvidu.io/api/openvidu-browser/classes/recordingevent.html), that inform clients about a session initializing or stopping the recording process. These events will only be triggered for the users connected to the session at that moment and users defined by property openvidu.recording.notification (this 2 conditions are the ones I explained in my previous message).

On the other hand, you can (and probably you will want to) retrieve further information about a Session directly from OpenVidu Server, pulling it when necessary through REST API or openvidu-java-client / openvidu-node-client. This must be done from your application's backend, as you will need the OpenVidu secret. For example, to get the status from a specific Session at any time through OpenVidu Server REST API: https://openvidu.io/docs/reference-docs/REST-API/#get-apisessionsltsession_idgt. To do the same with openvidu-node-client: https://openvidu.io/docs/reference-docs/openvidu-node-client/#fetch-session-status. As you will see, one of the properties of the Session object returned by these operations is recording property. That will tell you if the session is currently being recorded or not. You can then pass that information to your clients after they have joined and show some kind of alert or message to warn them about the recording process.

Another alternative would be to subscribe to OpenVidu webhook service from your appliaction's backend. Event recordingStatusChanged https://openvidu.io/docs/reference-docs/openvidu-server-cdr/#recordingstatuschanged will tell you when some session has started or stopped being recorded, and you may warn your users whenever that happens.

Regards.

Hi

But it's not working in our scenario. In my scenario after record started for one person i want to show message like "Record Started" to other persons
Reply all
Reply to author
Forward
0 new messages