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.
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
- 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
- Install the dependencies and create a build of the project using the commands below.
npm install
npm run build
- Host the contents of the build folder on your server and check if the template is up and running.
If you want to create the complete template from scratch you can follow this guide.
Using the template for recording
- Pass the URL of the template you deployed as
templateUrlin the Start Recording REST API. To generate the template URL, you will have to append theroomId, andtokenhas 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();
- 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.
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:

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

