fastpixgo

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 12 Imported by: 0

README

FastPix Go SDK

Homepage

Developer-friendly & type-safe Go SDK specifically designed to leverage the FastPix platform API.

Introduction

The FastPix Go SDK simplifies integration with the FastPix platform. This SDK is designed for secure and efficient communication with the FastPix API, enabling easy management of media uploads, live streaming, and simulcasting.

Key Features

  • Media API
    • Upload Media: Upload media files seamlessly from URLs or devices
    • Manage Media: List, fetch, update, and delete media assets
    • Playback IDs: Generate and manage playback IDs for media access
  • Live API
    • Create & Manage Live Streams: Create, list, update, and delete live streams
    • Control Stream Access: Generate playback IDs for live streams to control and manage access
    • Simulcast to Multiple Platforms: Stream content to multiple platforms simultaneously

For detailed usage, refer to the FastPix API Reference.

Prerequisites

  • Go 1.20 or later
  • FastPix API credentials (Username and Password)

Getting Started with FastPix

To get started with the FastPix Go SDK, ensure you have the following:

  • FastPix APIs are authenticated using a Username and Password (HTTP Basic Auth). You must generate these credentials to use the SDK.
  • Follow the steps in the Authentication section to obtain your credentials.

Table of Contents

SDK Installation

go get github.com/FastPix/fastpix-go@v0.1.0

Initialization

You can set the security parameters using the WithSecurity option when initializing the SDK client instance. For example:

package main

import (
	"context"
	fastpixgo "github.com/FastPix/fastpix-go"
	"github.com/FastPix/fastpix-go/models/components"
)

func main() {
	ctx := context.Background()
	sdk := fastpixgo.New(
		fastpixgo.WithSecurity(components.Security{
			Username: fastpixgo.String("your-username"),
			Password: fastpixgo.String("your-password"),
		}),
	)
	// Use sdk...
}

SDK Example Usage

package main

import (
	"context"
	fastpixgo "github.com/FastPix/fastpix-go"
	"github.com/FastPix/fastpix-go/models/components"
	"log"
)

func main() {
	ctx := context.Background()

	s := fastpixgo.New(
		fastpixgo.WithSecurity(components.Security{
			Username: fastpixgo.String(""),
			Password: fastpixgo.String(""),
		}),
	)

	res, err := s.StartLiveStream.CreateNewStream(ctx, &components.CreateLiveStreamRequest{
		PlaybackSettings: components.PlaybackSettings{},
		InputMediaSettings: components.InputMediaSettings{
			Metadata: &components.CreateLiveStreamRequestMetadata{},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.LiveStreamResponseDTO != nil {
		// handle response
	}
}

Available Resources and Operations

InputVideo
ManageLiveStream
ManageVideos
Playback
SimulcastStream
StartLiveStream

Error Handling

All operations return a response object or an error. By default, an API error will return an apierrors.APIError. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to the respective Errors tables in the SDK docs for more details on possible error types for each operation.

For example, the CreateNewStream function may return the following errors:

Error Type Status Code Content Type
apierrors.UnauthorizedError 401 application/json
apierrors.InvalidPermissionError 403 application/json
apierrors.ValidationErrorResponse 422 application/json
apierrors.APIError 4XX, 5XX /

Server Selection

The default server can be overridden globally using the WithServerURL(serverURL string) option when initializing the SDK client instance. For example:

sdk := fastpixgo.New(
	fastpixgo.WithServerURL("https://api.fastpix.io/v1/on-demand"),
	fastpixgo.WithSecurity(components.Security{
		Username: fastpixgo.String("your-username"),
		Password: fastpixgo.String("your-password"),
	}),
)

Development

Maturity

This SDK is currently in beta, and breaking changes may occur between versions even without a major version update. To avoid unexpected issues, we recommend pinning your dependency to a specific version. This ensures consistent behavior unless you intentionally update to a newer release.

Detailed Usage

For a complete understanding of each API's functionality, including request and response details, parameter descriptions, and additional examples, please refer to the FastPix API Reference.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerList = []string{

	"https://api.fastpix.io/v1/live",
}

ServerList contains the list of servers available to the SDK

Functions

func Bool

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func Pointer

func Pointer[T any](v T) *T

Pointer provides a helper function to return a pointer to a type

func String

func String(s string) *string

String provides a helper function to return a pointer to a string

Types

type FastPixSDK

type FastPixSDK struct {
	StartLiveStream  *StartLiveStream
	ManageLiveStream *ManageLiveStream
	Playback         *Playback
	SimulcastStream  *SimulcastStream
	InputVideo       *InputVideo
	ManageVideos     *ManageVideos
	// contains filtered or unexported fields
}

FastPixSDK - LIVE STREAMING API: The Live Stream APIs in FastPix simplifies the process of creating,managing, and distributing live content. This set of API endpoints is designed to help developers initiate live broadcasts, configure stream settings, and extend streams to external platforms (via simulcasting). By integrating FastPix's live streaming capabilities into your applications, you can provide users with seamless and high-quality live video experiences, whether for events, webinars, gaming, or live content creation.

Live streams can be customized with various parameters, such as stream metadata, privacy settings, and playback configurations. Additionally, the API supports real-time interaction with streams, including updating stream details, managing playback IDs, and extending the reach of a stream through simulcasting to platforms like YouTube or Facebook.

<h3>Use case scenarios</h3>

**Event Broadcasting**: A developer integrates FastPix live streaming APIs into an event management platform. By leveraging these APIs, the platform can enable event organizers to set up live streams for conferences, concerts, or webinars, allowing viewers to tune in from multiple platforms simultaneously via simulcasting.

**Live Content Platforms**: Developers working on a live content platform for creators can use the live stream APIs to allow users to broadcast gaming, vlogs, or tutorials. Creators can manage their streams in real time, control playback options, and extend their reach by simulcasting to popular platforms like Twitch or YouTube.

**Corporate Streaming Services**: A corporate communication tool can integrate live streaming functionality for internal town halls or global employee meetings. The live streams can be made accessible to different employee groups through privacy settings and playback control, ensuring secure and efficient internal communication.

func New

func New(opts ...SDKOption) *FastPixSDK

New creates a new instance of the SDK with the provided options

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for suplying the SDK with a custom HTTP client

type InputVideo

type InputVideo struct {
	// contains filtered or unexported fields
}

func (*InputVideo) CreateMedia

CreateMedia - Create media from URL This endpoint allows developers or users to create a new video or audio media in FastPix using a publicly accessible URL. FastPix will fetch the media from the provided URL, process it, and store it on the platform for use.

#### Public URL requirement:

The provided URL must be publicly accessible and should point to a video stored in one of the following supported formats: .m4v, .ogv, .mpeg, .mov, .3gp, .f4v, .rm, .ts, .wtv, .avi, .mp4, .wmv, .webm, .mts, .vob, .mxf, asf, m2ts

#### Supported storage types:

The URL can originate from various cloud storage services or content delivery networks (CDNs) such as:

* **Amazon S3:** URLs from Amazon's Simple Storage Service.

* **Google Cloud Storage:** URLs from Google Cloud's storage solution.

* **Azure Blob Storage:** URLs from Microsoft's Azure storage.

* **Public CDNs:** URLs from public content delivery networks that host video files.

Upon successful creation, the API returns an id that should be retained for future operations related to this media.

#### How it works

1. Send a POST request to the /on-demand endpoint with the media URL (typically a video or audio file) and optional media settings.

2. FastPix uploads the video from the provided URL to its storage.

3. Receive a response containing the unique id for the newly created media item.

4. Use the id in subsequent API calls, such as checking the status of the media with the **Get Media by ID** endpoint to determine when the media is ready for playback.

FastPix uses webhooks to tell your application about things that happen in the background, outside of the API regular request flow. For instance, once the media file is created (but not yet processed or encoded), we’ll shoot a POST message to the address you give us with the webhook event video.media.created.

Once processing is done you can look for the events video.media.ready and video.media.failed to see the status of your new media file.

#### Use case scenario

* **Use case:** A developer wants to integrate a user-generated content platform where users can upload links to their videos hosted on third-party platforms like AWS or Google Cloud Storage. This endpoint is used to create media directly from those URLs.

* **Detailed example:** Say you’re building an online learning platform where instructors upload video URLs hosted on their private cloud servers. By providing the video URL to this endpoint, the platform processes and adds it to your media library, ready for playback.

func (*InputVideo) DirectUploadVideoMedia

DirectUploadVideoMedia - Upload media from device This endpoint enables you to upload a video file directly from your local device to FastPix for processing, storage. When you invoke this API with your preferred media settings, the response returns an uploadId and a pre-signed URL, providing a streamlined experience for uploading.

#### How it works

1. Send a POST request to the /on-demand/uploads endpoint with optional media settings.

2. The response includes an **uploadId** and a pre-signed URL for direct video file upload.

3. Upload your video file to the provided **URL** by making **PUT** request. The API accepts the media file from the device and uploads it to the FastPix platform.

4. Once uploaded, the media undergoes processing and is assigned a unique ID for tracking. Retain this **uploadId** for any future operations related to this upload.

After uploading, you can use the **Get Media by ID** endpoint to check the status of the uploaded media asset and see if it has transitioned to a "ready" status for playback.

To notify your application about the status of this API request check for the webhooks for Upload related events.

#### Use case scenario

**Use case:** A social media platform allows users to upload video content directly from their phones or computers. This endpoint facilitates the upload process. For example, if you are developing a video-sharing app where users can upload short clips from their mobile devices, this endpoint enables them to select a video, upload it to the platform.

type ManageLiveStream

type ManageLiveStream struct {
	// contains filtered or unexported fields
}

func (*ManageLiveStream) DeleteLiveStream

func (s *ManageLiveStream) DeleteLiveStream(ctx context.Context, streamID string, opts ...operations.Option) (*operations.DeleteLiveStreamResponse, error)

DeleteLiveStream - Delete a stream Permanently removes a specified live stream from the workspace. If the stream is still active, the encoder will be disconnected, and the ingestion will stop. This action cannot be undone, and any future playback attempts will fail.

By providing the streamId, the API will terminate any active connections to the stream and remove it from the list of available live streams. You can further look for video.live_stream.deleted webhook to notify your system about the status.

**Example:** For an online concert platform, a trial stream was mistakenly made public. The event manager deletes the stream before the concert begins to avoid confusion among viewers.

func (*ManageLiveStream) GetAllStreams

GetAllStreams - Get all live streams Retrieves a list of all live streams associated with the user’s account (workspace). It provides an overview of both current and past live streams, including details like streamId, title, status, and creation time.

func (*ManageLiveStream) GetLiveStreamByID

func (s *ManageLiveStream) GetLiveStreamByID(ctx context.Context, streamID string, opts ...operations.Option) (*operations.GetLiveStreamByIDResponse, error)

GetLiveStreamByID - Get stream by ID This endpoint retrieves detailed information about a specific live stream by its unique streamId. It includes data such as the stream’s status (idle, preparing, active, disabled), metadata (title, description), and more.

**Practical example:** Suppose a news agency is broadcasting a live event and wants to track the configurations set for the live stream while also checking the stream's status.

func (*ManageLiveStream) UpdateLiveStream

func (s *ManageLiveStream) UpdateLiveStream(ctx context.Context, streamID string, patchLiveStreamRequest *components.PatchLiveStreamRequest, opts ...operations.Option) (*operations.UpdateLiveStreamResponse, error)

UpdateLiveStream - Update a stream This endpoint allows users to modify the parameters of an existing live stream, such as its metadata (title, description) or the reconnect window. It’s useful for making changes to a stream that has already been created but not yet ended. Once the live stream is disabled, you cannot update a stream.

The updated stream parameters and the streamId needs to be shared in the request, and FastPix will return the updated stream details. Once updated, video.live_stream.updated webhook event notifies your system.

**Practical example:** A host realizes they need to extend the reconnect window for their live stream in case they lose connection temporarily during the event. Or suppose during a multi-day online conference, the event organizers need to update the stream title to reflect the next day's session while keeping the same stream ID for continuity.

type ManageVideos

type ManageVideos struct {
	// contains filtered or unexported fields
}

func (*ManageVideos) DeleteMedia

func (s *ManageVideos) DeleteMedia(ctx context.Context, mediaID string, opts ...operations.Option) (*operations.DeleteMediaResponse, error)

DeleteMedia - Delete a media by ID This endpoint allows you to permanently delete a a specific video or audio media file along with all associated data. If you wish to remove a media file from FastPix storage, use this endpoint with the **mediaId** (either **uploadId** or **id**) received during the media's creation or upload.

#### How it works

1. Make a DELETE request to the **/on-demand/`<mediaId>`** endpoint, replacing `<mediaId>` with the uploadId or the id of the media you want to delete.

2. Confirm the deletion: Since this action is irreversible, ensure that you no longer need the media before proceeding. Once deleted, the media cannot be retrieved or played back.

3. Webhook event to look for: **video.media.deleted**

**Use case:** A user on a video-sharing platform decides to remove an old video from their profile, or suppose you're running a content moderation system, and one of the videos uploaded by a user violates your platform’s policies. Using this endpoint, the media is permanently deleted from your library, ensuring it’s no longer accessible or viewable by other users.

func (*ManageVideos) GetMedia

func (s *ManageVideos) GetMedia(ctx context.Context, mediaID string, opts ...operations.Option) (*operations.GetMediaResponse, error)

GetMedia - Get a media by ID By calling this endpoint, you can retrieve detailed information about a specific media item, including its current status and a playbackId. This is particularly useful for retrieving specific media details when managing large content libraries.

#### How it works

1. Make a GET request to the **/on-demand/`<mediaId>`** endpoint, replacing `<mediaId>` with the **uploadId** received during the upload process or the id obtained when creating media from a URL.

2. Receive a response that includes details about the media, including:

* **status:** Indicates whether the media is still “preparing” or has transitioned to "ready."

* **playbackId:** The playbackId is a unique identifier that allows you to stream the media once it is ready. You can construct the stream URL dynamically using the playbackId in the following format: `https://stream.fastpix.io/<playbackId>.m3u8`

**Please note:** Polling this API will let you know the status that whether the upload media has been moved to ready status, so that you can get started with streaming your media.

#### Use case scenario

**Use case:** Suppose your platform provides users with an interface where they can manage their uploaded content. A user requests detailed information about a specific video to see if it has been fully processed and is available for playback. Using the media ID, you can fetch the information from FastPix and display it in the user’s dashboard.

func (*ManageVideos) ListMedia

func (s *ManageVideos) ListMedia(ctx context.Context, limit *int64, offset *int64, orderBy *operations.ListMediaOrderBy, opts ...operations.Option) (*operations.ListMediaResponse, error)

ListMedia - Get list of all media This endpoint returns a list of all media files created from a URL or uploaded as file objects within your organization. Each media entry contains metadata such as the media ID, creation date, status, and type. It allows you to retrieve a comprehensive overview of your media assets, making it easier to manage and review them.

#### How it works

When called, the API provides a paginated response containing the media items in the organization's library. This is helpful for retrieving a large volume of media and managing content in bulk.

#### Use case scenario

* **Use case:** A content manager at a video-on-demand platform wants to see all uploaded media to assess the quality and status of videos.

* **Detailed example:** You're managing a video platform and need to check all the uploaded media in your library to ensure no outdated or low-quality content is being served. Using this endpoint, you can retrieve a complete list of media, allowing you to filter, sort, or update items as needed.

func (*ManageVideos) RetrieveMediaInputInfo

func (s *ManageVideos) RetrieveMediaInputInfo(ctx context.Context, mediaID string, opts ...operations.Option) (*operations.RetrieveMediaInputInfoResponse, error)

RetrieveMediaInputInfo - Get info of media inputs Allows you to retrieve detailed information about the media inputs associated with a specific media item. You can use this endpoint to verify the media file’s input URL, track creation status, and container format. The mediaId (either uploadId or id) must be provided to fetch the information.

#### How it works

Upon making a GET request with the mediaId, FastPix returns a response that includes:

* **Input-url:** The URL of the uploaded media file.

* **tracks:** Information about the tracks associated with the media, including both video and audio tracks, indicating whether they have been successfully created.

* **containerFormat:** The format of the uploaded media file container (e.g., MP4, MKV).

This endpoint is particularly useful for ensuring that all necessary tracks (video and audio) have been correctly associated with the media during the upload or media creation process.

func (*ManageVideos) UpdatedMedia

UpdatedMedia - Update a media by ID This endpoint allows you to update specific parameters of an existing media file. You can modify the key-value pairs of the metadata that were provided in the payload during the creation of media from a URL or when uploading the media as a file object.

#### How it works

1. Make a PATCH request to the **/on-demand/`<mediaId>`** endpoint, replacing `<mediaId>` with the uploadId or the id of the media you want to update.

2. Include the updated parameters in the request body.

3. Receive a response containing the updated media data, confirming the changes made.

Once you have made the update request, you can also look for the webhook event **video.media.updated** to notify your system about update status.

**Use case:** Imagine a scenario where a user uploads a video and later realizes they need to change the title, add a new description or tags. You can use this endpoint to update the media metadata without having to re-upload the entire video.

type Playback

type Playback struct {
	// contains filtered or unexported fields
}

func (*Playback) CreateMediaPlaybackID

CreateMediaPlaybackID - Create a playback ID You can create a new playback ID for a specific media asset. If you have already retrieved an existing playbackId using the "Get Media by ID" endpoint for a media asset, you can use this endpoint to generate a new playback ID with a specified access policy.

If you want to create a private playback ID for a media asset that already has a public playback ID, this endpoint also allows you to do so by specifying the desired access policy.

#### How it works

1. **Make a POST request** to the **/on-demand/`<mediaId>`/playback-ids** endpoint, replacing `<mediaId>` with the uploadId or id of the media asset.

2. Include the **access policy** in the request body to indicate whether the new playback ID should be private or public.

3. Receive a response containing the newly created playback ID with the requested access level.

**Use case:** A video streaming service generates playback IDs for each media file when users request to view specific content. The playback ID is then used by the video player to stream the video.

func (*Playback) CreatePlaybackIDOfStream

func (s *Playback) CreatePlaybackIDOfStream(ctx context.Context, streamID string, playbackIDRequest *components.PlaybackIDRequest, opts ...operations.Option) (*operations.CreatePlaybackIDOfStreamResponse, error)

CreatePlaybackIDOfStream - Create a playbackId Generates a new playback ID for the live stream, allowing viewers to access the stream through this ID. The playback ID can be shared with viewers for direct access to the live broadcast.

By calling this endpoint with the streamId, FastPix returns a unique playbackId, which can be used to stream the live content.

**Use case:** A media platform needs to distribute a unique playback ID to users for an exclusive live concert. The platform can also embed the stream on various partner websites.

func (*Playback) DeleteMediaPlaybackID

func (s *Playback) DeleteMediaPlaybackID(ctx context.Context, mediaID string, playbackID string, opts ...operations.Option) (*operations.DeleteMediaPlaybackIDResponse, error)

DeleteMediaPlaybackID - Delete a playback ID This endpoint allows you to remove a specific playback ID associated with a media asset. Deleting a playbackId will revoke access to the media content linked to that ID.

#### How it works

1. Make a DELETE request to the **/on-demand/`<mediaId>`/playback-ids** endpoint, replacing `<mediaId>` with the uploadId or id of the media asset from which you want to delete the playback ID.

2. Specify the playback ID you wish to delete in the request body.

**Use case:** Your platform offers limited-time access to premium content. When the subscription expires, you can revoke access to the content by deleting the associated playback ID, preventing users from streaming the video further.

func (*Playback) DeletePlaybackIDOfStream

func (s *Playback) DeletePlaybackIDOfStream(ctx context.Context, streamID string, playbackID string, opts ...operations.Option) (*operations.DeletePlaybackIDOfStreamResponse, error)

DeletePlaybackIDOfStream - Delete a playbackId Deletes a previously created playback ID for a live stream. This will prevent any new viewers from accessing the stream through the playback ID, though current viewers will be able to continue watching for a limited time before being disconnected. By providing the playbackId, FastPix deletes the ID and ensures new playback requests will fail.

**Use case:** A streaming service wants to prevent new users from joining a live stream that is nearing its end. The host can delete the playback ID to ensure no one can join the stream or replay it once it ends.

func (*Playback) GetLiveStreamPlaybackID

func (s *Playback) GetLiveStreamPlaybackID(ctx context.Context, streamID string, playbackID string, opts ...operations.Option) (*operations.GetLiveStreamPlaybackIDResponse, error)

GetLiveStreamPlaybackID - Get stream's playbackId Retrieves details about a previously created playback ID. If you provide the distinct playback ID that was given back to you in the previous stream or playbackId create request, FastPix will provide the relevant playback details such as the access policy.

**Use case:** A developer needs to confirm the playback ID details to ensure the right stream is being accessed by viewers.

type SDKOption

type SDKOption func(*FastPixSDK)

func WithClient

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithRetryConfig

func WithRetryConfig(retryConfig retry.Config) SDKOption

func WithSecurity

func WithSecurity(security components.Security) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithSecuritySource

func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption

WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication

func WithServerIndex

func WithServerIndex(serverIndex int) SDKOption

WithServerIndex allows the overriding of the default server by index

func WithServerURL

func WithServerURL(serverURL string) SDKOption

WithServerURL allows the overriding of the default server URL

func WithTemplatedServerURL

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

func WithTimeout

func WithTimeout(timeout time.Duration) SDKOption

WithTimeout Optional request timeout applied to each operation

type SimulcastStream

type SimulcastStream struct {
	// contains filtered or unexported fields
}

func (*SimulcastStream) CreateSimulcastOfStream

func (s *SimulcastStream) CreateSimulcastOfStream(ctx context.Context, streamID string, simulcastRequest *components.SimulcastRequest, opts ...operations.Option) (*operations.CreateSimulcastOfStreamResponse, error)

CreateSimulcastOfStream - Create a simulcast Lets you to create a simulcast for a parent live stream. A simulcast enables you to broadcast the live stream to multiple platforms simultaneously (e.g., YouTube, Facebook, or Twitch). This feature is useful for expanding your audience reach across different platforms. However, a simulcast can only be created when the parent live stream is in an idle state (i.e., not currently live or disabled). Additionally, only one simulcast target can be created per API call.

<h4>How it works</h4>

Upon calling this endpoint, you need to provide the parent streamId and the details of the simulcast target (platform and credentials). The system will generate a unique simulcastId, which can be used to manage the simulcast later.

To notify your application about the status of simulcast related events check for the webhooks for simulcast target events.

**Practical example:** 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.

func (*SimulcastStream) DeleteSimulcastOfStream

func (s *SimulcastStream) DeleteSimulcastOfStream(ctx context.Context, streamID string, simulcastID string, opts ...operations.Option) (*operations.DeleteSimulcastOfStreamResponse, error)

DeleteSimulcastOfStream - Delete a simulcast Allows you to delete a simulcast using its unique simulcastId, which was returned during the simulcast creation process. Deleting a simulcast stops the broadcast to the associated platform, but the parent stream will continue to run if it is live. This action is irreversible, and a new simulcast would need to be created if you want to resume streaming to the same platform.

**Use case:** A broadcaster needs to stop simulcasting to one platform due to technical difficulties while keeping the stream active on others. For example, a tech company is simulcasting a product launch on multiple platforms. Midway through the event, they decide to stop the simulcast on Facebook due to performance issues, but keep it running on YouTube. They call this API to delete the Facebook simulcast target.

func (*SimulcastStream) GetSpecificSimulcastOfStream

func (s *SimulcastStream) GetSpecificSimulcastOfStream(ctx context.Context, streamID string, simulcastID string, opts ...operations.Option) (*operations.GetSpecificSimulcastOfStreamResponse, error)

GetSpecificSimulcastOfStream - Get a specific simulcast of a stream 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 (active or idle), and metadata.

**Use case:** This endpoint can be used to verify the status of the simulcast on external platforms before the live stream begins. For instance, 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.

func (*SimulcastStream) UpdateSpecificSimulcastOfStream

func (s *SimulcastStream) UpdateSpecificSimulcastOfStream(ctx context.Context, streamID string, simulcastID string, simulcastUpdateRequest *components.SimulcastUpdateRequest, opts ...operations.Option) (*operations.UpdateSpecificSimulcastOfStreamResponse, error)

UpdateSpecificSimulcastOfStream - Update a specific simulcast of a stream Allows you to enable or disable a specific simulcast associated with a parent live stream. The status of the simulcast can be updated at any point, whether the live stream is active or idle. However, once the live stream is disabled, the simulcast can no longer be modified.

**Use case:** When a PATCH request is made to this endpoint, the API updates the status of the simulcast. This can be useful for pausing or resuming a simulcast on a particular platform without stopping the parent live stream.

type StartLiveStream

type StartLiveStream struct {
	// contains filtered or unexported fields
}

func (*StartLiveStream) CreateNewStream

CreateNewStream - Create a new stream Allows you to initiate a new RTMP or SRT live stream on FastPix. Upon creating a stream, FastPix generates a unique stream key and SRT secret, which can be used with any broadcasting software (like OBS) to connect to FastPix's RTMP or SRT servers. Users can configure the stream settings, including metadata (such as stream name and description), reconnect window (in case of disconnection), privacy options (public or private), and advanced features like enabling DVR mode. Leverage SRT for live streaming in environments with unstable networks, taking advantage of its error correction and encryption features for a resilient and secure broadcast.

<h4>How it works</h4>

When a user sends a POST request to this endpoint, FastPix returns the stream details for both RTMP and SRT configurations. These keys and IDs from the stream details are essential for connecting the broadcasting software to FastPix’s servers and transmitting the live stream to viewers. FastPix uses <a href=https://docs.fastpix.io/docs/webhooks-for-status#/>webhooks</a> to tell your application about things that happen in the background, outside of the API regular request flow. For instance, once the live stream is created, we’ll shoot a POST message to the address you give us with the webhook event <a href=https://docs.fastpix.io/docs/video-live_stream-created#/>video.live_stream.created</a>. Here’re <a href=https://docs.fastpix.io/docs/webhooks-for-status#/live-stream-related-events>other live stream event related</a> webhooks you would want to look for.

**Use case:** A gaming content creator initiates a live stream through the API, specifying a 1080p resolution and public access. They receive the stream key, RTMP and SRT details in the response. Using the SRT connection, they broadcast a high-action gaming session with reduced latency, offering viewers a seamless experience.

**Detailed example:**

Imagine a gaming platform that allows users to live stream gameplay directly from their dashboard. The API creates a new stream, provides the necessary stream key, and sets it to "private" so that only specific viewers can access it.

Directories

Path Synopsis
internal
models

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL