Skip to main content
Version: 3.x.x

Record Meeting - Android

VideoSDK allows you to record video & audio during the meeting. The recording files are available in developer dashboard or you can also choose to store them in your own cloud storage.

You can set the recording layout with a prebuilt layout in the configuration, or with your own custom template.

This guide shows how to start and stop recording a meeting.

important

To initiate automatic recording at the beginning of a session, simply provide the autoStartConfig feature recording during room creation. For more information on configuring the autoStartConfig, please refer to the provided documentation here.

startRecording()​

startRecording() can be used to start a recording of the meeting which can be accessed from the Meeting class. This method accepts four parameters:

  • 1. webhookUrl: The webhook URL that receives recording events, such as the recording starting and stopping. It is called when the recording is complete and stored on the server. Read more about webhooks here

  • 2. awsDirPath: The path in your S3 bucket where you want to store recordings. To let VideoSDK store recordings in your bucket, fill in this form with the required values. (VideoSDK Cloud (AWS S3, Azure Blob or GCP ) Integration)

  • 3. config: This parameter will define how the meeting should be recorded. The values are case-sensitive, so write them exactly as shown below.

  • 4. transcription: This parameter lets you start post transcription for the recording.

note

If you don't have a value for webhookUrl,awsDirPath, config or transcription, you should pass null in place of the missing value. If you pass null in awsDirPath parameter then recordings are stored on VideoSDK's storage.

note
  • startRecording() and stopRecording() are suspend functions. Call them from a coroutine, such as lifecycleScope.launch (from androidx.lifecycle:lifecycle-runtime-ktx).
  • They return once the request is sent, not when the recording has started or stopped. Wait for onRecordingStateChanged to report RECORDING_STARTED or RECORDING_STOPPED.
  • If the request fails, they throw VideoSDKException.
  • Called before the meeting is joined, or while it is reconnecting, they do nothing and report 3035 (ERROR_ACTION_PERFORMED_BEFORE_ROOM_JOINED) or 3065 (ERROR_ROOM_RECONNECTING) on onError instead of throwing.
val config = JSONObject()

// Layout Configuration
val layout = JSONObject()
layout.put("type", "GRID") // "SPOTLIGHT" | "SIDEBAR", Default : "GRID"
layout.put("priority", "SPEAKER") // "PIN", Default : "SPEAKER"
layout.put("gridSize", 4) // MAX : 4
config.put("layout", layout)

// Theme of recording
config.put("theme", "DARK") // "LIGHT" | "DEFAULT"

// `mode` is used to either record video & audio both or only audio.
config.put("mode", "video-and-audio") // "audio", Default : "video-and-audio"

// Quality of recording and is only applicable to `video-and-audio` type mode.
config.put("quality", "high") /* Default : "med"
"low" (SD Recording) | "med" (HD Recording) | "high" (FHD Recording) */

// This mode refers to orientation of recording.
// landscape : Record the meeting in horizontally
// portrait : Record the meeting in vertically (Best for mobile view)
config.put("orientation", "portrait") // "landscape", Default : "landscape"

// Post Transcription Configuration
val prompt = "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary"
val summaryConfig = SummaryConfig(true, prompt)
val modelId = "raman_v1"
val transcription = PostTranscriptionConfig(true, summaryConfig, modelId)

lifecycleScope.launch {
try {
meeting.startRecording(null, null, config, transcription)
} catch (e: VideoSDKException) {
Log.e("VideoSDK", "Start recording failed: ${e.code} ${e.name}")
}
}

stopRecording()​

  • stopRecording() is used to stop the meeting recording which can be accessed from the Meeting class.

Example​

// keep track of recording, updated in onRecordingStateChanged below
var isRecording = false

findViewById<View>(R.id.btnRecording).setOnClickListener { view: View? ->
lifecycleScope.launch {
try {
if (!isRecording) {
val config = JSONObject()
val layout = JSONObject()
layout.put("type", "GRID")
layout.put("priority", "SPEAKER")
layout.put("gridSize", 4)
config.put("layout", layout)
config.put("theme", "DARK")
config.put("mode", "video-and-audio")
config.put("quality", "high")
config.put("orientation", "portrait")

// Post Transcription Configuration
val prompt = "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary"
val summaryConfig = SummaryConfig(true, prompt)
val modelId = "raman_v1"
val transcription = PostTranscriptionConfig(true, summaryConfig, modelId)

// Start Recording
// If you don't have a `webhookUrl` or `awsDirPath`, you should pass null.
// If you don't want to enable transcription, you can pass null as parameter.
meeting!!.startRecording("YOUR WEB HOOK URL", "AWS Directory Path", config, transcription)
} else {
// Stop Recording
meeting!!.stopRecording()
}
} catch (e: VideoSDKException) {
Log.e("VideoSDK", "Recording request failed: ${e.code} ${e.name}")
}
}
}

Event associated with Recording​

  • onRecordingStateChanged - Whenever meeting recording state changes, then onRecordingStateChanged event will trigger.
private val meetingEventListener: MeetingEventListener = object : MeetingEventListener() {
override fun onRecordingStateChanged(recordingState: String) {
when (recordingState) {
"RECORDING_STARTING" -> {
Log.d("onRecordingStateChanged", "Meeting recording is starting")
}
"RECORDING_STARTED" -> {
isRecording = true
Log.d("onRecordingStateChanged", "Meeting recording is started")
}
"RECORDING_STOPPING" -> {
Log.d("onRecordingStateChanged", "Meeting recording is stopping")
}
"RECORDING_STOPPED" -> {
isRecording = false
Log.d("onRecordingStateChanged", "Meeting recording is stopped")
}
}
}
}

override fun onCreate(savedInstanceState: Bundle?) {
//...

// add listener to meeting
meeting!!.addEventListener(meetingEventListener)
}

Storage Configuration​

While recording your meetings, you can choose to store them on the VideoSDK's storage or you can also configure your own AWS S3 Storage, Azure Blob or GCP Cloud Storage to store the meeting recordings directly on your storage.

You can configure your own AWS S3 Storage, Azure Blob or GCP Cloud Storage from the VideoSDK Dashboard's API section.

You can also go through this guide to setup the storage or watch this video to configure your storage.

Custom Template​

With VideoSDK, you can also use your own custom designed layout template to record the meetings. In order to use the custom template, you need to create a template for which you can follow this guide. Once you have setup the template, you can use the REST API to start the recording with the templateUrl parameter.

API Reference​

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

Got a Question? Ask us on discord