- create - Create a simulcast
Creates a simulcast for a parent live stream. Simulcasting allows you to broadcast a live stream to multiple social platforms simultaneously (for example, YouTube, Facebook, or Twitch). This helps expand your audience reach across platforms. A simulcast can only be created when the parent live stream is in the idle state (not currently live or disabled). Only one simulcast target can be created per API call.
-
Change to: When you call this endpoint, provide the parent
streamIdalong with the simulcast target details (such as platform and credentials). The API returns a uniquesimulcastId, which you can use to manage the simulcast later. -
To notify your application about the status of simulcast related events check for the webhooks for simulcast target events.
An event manager sets up a live stream for a virtual conference and wants to simulcast the stream on YouTube and Facebook Live. They first create the primary live stream in FastPix, ensuring it's in the idle state. Then, they use the API to create a simulcast target for YouTube.
Related guide: Simulcast to 3rd party platforms
Note: In the examples below,
package hello.world;is used for demonstration purposes. When creating your own Java files, ensure the package name matches your directory structure (e.g., if your file is atsrc/main/java/com/example/MyApp.java, usepackage com.example;).
// Package declaration - adjust to match your project's directory structure
package hello.world;
// Import required classes from the FastPix SDK
import java.lang.Exception;
import java.util.Map;
import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.components.SimulcastRequest;
import io.fastpix.sdk.models.operations.CreateSimulcastOfStreamResponse;
import io.fastpix.sdk.utils.JSON;
public class Application {
public static void main(String[] args) throws Exception {
FastPixSDK sdk = FastPixSDK.builder()
.security(Security.builder()
.username("your-access-token")
.password("your-secret-key")
.build())
.build();
CreateSimulcastOfStreamResponse res = sdk.simulcastStream().create()
.streamId("your-stream-id")
.body(SimulcastRequest.builder()
.url("rtmp://hyd01.contribute.live-video.net/app/")
.streamKey("live_1012464221_DuM8W004MoZYNxQEZ0czODgfHCFBhk")
.metadata(Map.ofEntries(
Map.entry("livestream_name", "Tech-Connect Summit")))
.build())
.call();
if (res.simulcastResponse().isPresent()) {
var mapper = JSON.getMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
System.out.println(mapper.writeValueAsString(res.simulcastResponse().get()));
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
streamId |
String | ✔️ | After creating a new live stream, FastPix assigns a unique identifier to the stream. | your-stream-id |
body |
SimulcastRequest | ✔️ | N/A | { "url": "rtmp://hyd01.contribute.live-video.net/app/", "streamKey": "live_1012464221_DuM8W004MoZYNxQEZ0czODgfHCFBhk", "metadata": { "livestream_name": "Tech-Connect Summit" } } |
CreateSimulcastOfStreamResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |