Recording works the same way on every platform. The publisher's application uses an SDK to open a session with the Media Server and publishes the camera and microphone as a stream with a unique name, plus one option: record it.
The SDK only passes this option on; everything else happens on the server. The Media Server writes the received audio and video to a file while the stream is live and finalizes the file when publishing stops.
Viewers are not affected: they play the same stream as before, and the publisher sends it only once, with no extra upload for the recording.
Now let's see how to publish a stream with recording enabled from each SDK.
The code looks a little different on each platform, but in every SDK recording is one option of the published stream.
Web SDK
In a browser, the Web SDK publishes the stream, and one option asks the Media Server to record it:
session
.createStream({
name: 'alice-live',
display: localPreview,
record: true,
})
.publish();
Explore Web SDK↗
Android SDK
On Android recording is enabled in the stream options before publishing:
StreamOptions options = new StreamOptions("alice-live");
options.setRecord(true);
Stream stream = session.createStream(options);
stream.publish();
Explore Android SDK↗
iOS SDK
On iOS recording is one more property of the stream options:
let options = FPWCSApi2StreamOptions()
options.name = "alice-live"
options.display = localView
options.record = true
let stream = try session.createStream(options)
try stream.publish()
Explore iOS SDK↗