SessionCam Notification Method

There may be scenarios in which you want to receive a "notification" in the browser that the recording has started or that the status of recording is on/off. These notifications can be requested using the configuration object for SessionCam as detailed below. The code below must be fired before the main SessionCam recorder tag on the page.

Detecting if the Recording is On or Off

The JavaScript below will add a log message to the console simply stating the recording is off if this is returned from our config.aspx call or if the sc.Status cookie returns a value meaning that the recording is off. You can modify the function to post data to another solution or to perform other actions.

<script type="text/javascript">
screcordingoff = function(){console.log('im off')};
if (!window.sessioncamConfiguration){
window.sessioncamConfiguration = new Object();
}
sessioncamConfiguration.notifications= [{event : 'recording/off', listener : screcordingoff}];
</script>

The JavaScript below will add a log message to the console simply stating the recording is on if this is returned from our config.aspx call. You can modify the function to post data to another solution or to perform other actions. This notification method will run when our config.aspx call has been made.

<script type="text/javascript>
screcordingon = function(){console.log('im on')};
if (!window.sessioncamConfiguration){
window.sessioncamConfiguration = new Object();
}
sessioncamConfiguration.notifications= [{event : 'recording/on', listener : screcordingon}];
</script>

Detecting if the session has started recording

The JavaScript below will add a log message to the console simply stating the session has started You can modify the function to post data to another solution or to perform other actions. This notification method will run when our config.aspx call has been made. A use case for this could be to obtain the SessionId as per this article (Obtaining a visitors SessionId).

<script type="text/javascript">
scsessionstarted = function(){console.log('ive started')};
if (!window.sessioncamConfiguration){
window.sessioncamConfiguration = new Object();
}
sessioncamConfiguration.notifications= [{event : 'session/started', listener : scsessionstarted}];
</script>

Combining the notifications

It is possible to combine multiple notifications into one command if you wanted to perform different actions. For example please see below:

<script type="text/javascript">
scsessionstarted = function(){console.log('ive started')}; screcordingon = function(){console.log('im on')}; screcordingoff = function(){console.log('im off')};
if (!window.sessioncamConfiguration){
window.sessioncamConfiguration = new Object();
}
sessioncamConfiguration.notifications= [{event : 'session/started', listener : scsessionstarted},{event : 'recording/on', listener : screcordingon},{event : 'recording/off', listener : screcordingoff}];
</script>