Skip to main content
Version: 2.x.x

Geo Tag Room Recordings - React Native

To ensure compliance for BFSIs doing vKYC, it is important to include the coordinates (location) of the customer in the recordings. You can do this with a custom template.

A ready-to-use template for this use case is here. To use this template with your recordings, follow the steps below.

note

This page uses the following asynchronous methods. Refer to their API reference for the errors each Promise may reject with, and handle these rejections appropriately based on your use case.

Host the template​

  1. Clone the template repository and switch to the branch template/geo-tag-watermark.
git clone https://github.com/videosdk-live/videosdk-rtc-react-prebuilt-ui.git
cd videosdk-rtc-react-prebuilt-ui
git checkout template/geo-tag-watermark
  1. Install the dependencies and create a build of the project using the commands below.
npm install
npm run build
  1. Host the contents of the build folder on your server and check if the template is up and running.
note

If you want to create the complete template from scratch you can follow this guide.

Using the template for recording​

  1. Pass the URL of the template you deployed as templateUrl in the Start Recording REST API. To generate the template URL, you will have to append the roomId, and token has to be added in the query parameters. Also if you are using the template provided above you need to added a few extra paramters mentioned below. Here is the code snippet to generate the URL.
async function main() {
let roomId = "Your RoomID";
let token = "Your Token";
const templateUrl = `https://YOUR_TEMPLATE_URL/?meetingId=${roomId}&token=${token}&name=recorder&isRecorder=true&joinWithoutUserInteraction=true`;

console.log(templateUrl);
}

main();
  1. Start the recording with that template URL using the API call below.
async function main() {
let roomId = "Your RoomID";
let token = "Your Token";
const templateUrl = `https://YOUR_TEMPLATE_URL/?meetingId=${roomId}&token=${token}&name=recorder&isRecorder=true&joinWithoutUserInteraction=true`;

console.log(templateUrl);

//Using the previouly created template URL and starting the recording using the API.
const options = {
method: "POST",
headers: {
Authorization: "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
roomId: "Your RoomId",
templateUrl: templateUrl,
}),
};
const url = `https://api.videosdk.live/v2/recordings/start`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
}

main();

Updating the Geo Tagging Coordinates​

Use PubSub to send the location. The predefined template listens on the GEO_TAG topic. Publish the participantName, latitude and longitude of the participant whose location you want to show in the recording.

note

You will have to fetch the longitude and latitude of the participant before sending it using the pubsub.

Here is how to publish the message:

function Watermark() {
const { messages, publish } = usePubSub("GEO_TAG");

const sendCoordinates = async () => {
try {
await publish(
"GEO TAG DATA",
{ persist: true },
{
latitude: "LATITUDE OF PARTICIPANT",
longitude: "LONGITUDE OF PARTICIPANT",
participantName: "NAME OF PARTICIPANT",
}
);
} catch (error) {
console.log("Error while publishing:", error);
}
};

return <></>;
}

After implementing this, you should get the recording in the following format:

Geo Tagging Recording

If you wish to change how the UI looks in the recording, you can change it by updating the layout in the template itself.

API Reference​

The API references for all the methods utilized in this guide are provided below.

Got a Question? Ask us on discord