Recording in Live Stream - iOS
This guide will provide an overview of how to implement start and stop Recording during a live stream.
startRecording()
​
The startRecording()
method, accesible from the useMeeting
hook, is used to initiate the recording of a live stream. This method accepts the following four parameters:
-
1. webhookUrl (optional)
: This is the webhook URL where you can listen to events related to the recording, such as the start and stop of recording. It triggers when the recording is completed and stored on the server. You can learn more about webhooks here -
2. awsDirPath (optional)
: This parameter specifies the path to your S3 bucket where you intend to store the recordings. To enable the storage of recordings in your S3 bucket with VideoSDK, follow this guide (VideoSDK Cloud (AWS S3, Azure Blob or GCP ) Integration) -
3. config (optional)
: This parameter defines how the recording should be conducted -
4. transcription (optional)
: This parameter lets you start post transcription for the recording.cautionIf you don't have a value for
webhookUrl
orawsDirPath
and wish to utilize theconfig
property, you should passnull
in place of the missing values. Failing to do so may result in the configuration not being applied to the recording.
- Swift
class LiveStreamViewController {
// button to start recording the meeting
@IBAction func recordMeetingButtonTapped(_ sender: Any) {
let transcription: PostTranscriptionConfig = PostTranscriptionConfig(
enabled: true,
summary: SummaryConfig(
enabled: true,
prompt: "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary"
)
)
self.meeting?.startRecording(webhookUrl: "<your webhook-url>",
awsDirPath: "<your awsDirPath>",
config: RecordingConfig(layout: ConfigLayout(type: .GRIDpriority: .SPEAKER, gridSize: 4),
theme: .DARK, mode: .video_and_audio,
quality: .high,
orientation: .portrait),
transcription: transcription)
}
}
stopRecording()
​
The stopRecording()
method, accesible from the useMeeting
hook, is used to stop the recording of a live stream.
Example​
- Swift
class LiveStreamViewController {
// button to stop recording the meeting
@IBAction func stopRecordingButtonTapped(_ sender: Any) {
self.meeting?.stopRecording()
}
}
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.
Events associated with recording​
- onRecordingStateChanged - Whenever meeting recording state changes, then
onRecordingStateChanged
event will trigger.
- Swift
extension LiveStreamViewController : MeetingEventListner {
//recording event
func onRecordingStateChanged(state: RecordingState) {
switch(state) {
case .RECORDING_STARTING:
print("recording starting")
case .RECORDING_STARTED:
print("recording started")
case .RECORDING_STOPPING:
print("recording stopping")
case .RECORDING_STOPPED:
print("recording stopped")
}
}
}
API Reference​
The API references for all the methods utilised in this guide are provided below.
Got a Question? Ask us on discord