Skip to content

Latest commit

 

History

History
141 lines (101 loc) · 10.5 KB

File metadata and controls

141 lines (101 loc) · 10.5 KB

SimulcastStreams

Overview

Available Operations

delete

Deletes a simulcast using its unique simulcastId, which you received during the simulcast creation process. Deleting a simulcast stops the broadcast to the associated platform, while the parent stream continues if it’s live. This action can’t be undone, and you must create a new simulcast to resume streaming to the same platform.

Webhook event: video.live_stream.simulcast_target.deleted

Example

A broadcaster may need to stop simulcasting to one platform while keeping the stream active on others. For example, a tech company is simulcasting a product launch across multiple platforms. Midway through the event, they decide to stop the simulcast on Facebook due to performance issues but continue streaming on YouTube. They use this API to delete the Facebook simulcast target.

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 at src/main/java/com/example/MyApp.java, use package com.example;).

Example Usage

// 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 com.fasterxml.jackson.databind.SerializationFeature;
import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.operations.DeleteSimulcastOfStreamResponse;
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();

        DeleteSimulcastOfStreamResponse res = sdk.simulcastStreams().delete()
                .streamId("your-stream-id")
                .simulcastId("your-simulcast-id")
                .call();

        if (res.simulcastdeleteResponse().isPresent()) {
            var mapper = JSON.getMapper();
            mapper.enable(SerializationFeature.INDENT_OUTPUT);
            System.out.println(mapper.writeValueAsString(res.simulcastdeleteResponse().get()));
        }
    }
}

Parameters

Parameter Type Required Description Example
streamId String ✔️ After creating a new live stream, FastPix assigns a unique identifier to the stream. your-stream-id
simulcastId String ✔️ When you create the new simulcast, FastPix assign a universal unique identifier which can contain a maximum of 255 characters. your-simulcast-id

Response

DeleteSimulcastOfStreamResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

getSpecific

Retrieves the details of a specific simulcast associated with a parent live stream. By providing both the streamId of the parent stream and the simulcastId, FastPix returns detailed information about the simulcast, such as the stream URL, the status of the simulcast, and metadata.

Example

This endpoint can be used to verify the status of the simulcast on external platforms before the live stream begins. For example, before starting a live gaming event, the organizer wants to ensure that the simulcast to Twitch is set up correctly. They retrieve the simulcast information to confirm that everything is properly configured.

Example Usage

// 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 com.fasterxml.jackson.databind.SerializationFeature;
import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.operations.GetSpecificSimulcastOfStreamResponse;
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();

        GetSpecificSimulcastOfStreamResponse res = sdk.simulcastStreams().getSpecific()
                .streamId("your-stream-id")
                .simulcastId("your-simulcast-id")
                .call();

        if (res.simulcastResponse().isPresent()) {
            var mapper = JSON.getMapper();
            mapper.enable(SerializationFeature.INDENT_OUTPUT);
            System.out.println(mapper.writeValueAsString(res.simulcastResponse().get()));
        }
    }
}

Parameters

Parameter Type Required Description Example
streamId String ✔️ After creating a new live stream, FastPix assigns a unique identifier to the stream. your-stream-id
simulcastId String ✔️ When you create the new simulcast, FastPix assign a universal unique identifier which can contain a maximum of 255 characters. your-simulcast-id

Response

GetSpecificSimulcastOfStreamResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*