Documentation
¶
Index ¶
- Variables
- func Bool(b bool) *bool
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func Int(i int) *int
- func Int64(i int64) *int64
- func Pointer[T any](v T) *T
- func String(s string) *string
- type DRMConfigurations
- func (s *DRMConfigurations) GetDrmConfiguration(ctx context.Context, offset *int64, limit *int64, opts ...operations.Option) (*operations.GetDrmConfigurationResponse, error)
- func (s *DRMConfigurations) GetDrmConfigurationByID(ctx context.Context, drmConfigurationID string, opts ...operations.Option) (*operations.GetDrmConfigurationByIDResponse, error)
- type Dimensions
- type Errors
- type Fastpixgo
- type HTTPClient
- type InVideoAIFeatures
- func (s *InVideoAIFeatures) UpdateMediaChapters(ctx context.Context, mediaID string, ...) (*operations.UpdateMediaChaptersResponse, error)
- func (s *InVideoAIFeatures) UpdateMediaModeration(ctx context.Context, mediaID string, ...) (*operations.UpdateMediaModerationResponse, error)
- func (s *InVideoAIFeatures) UpdateMediaNamedEntities(ctx context.Context, mediaID string, ...) (*operations.UpdateMediaNamedEntitiesResponse, error)
- func (s *InVideoAIFeatures) UpdateMediaSummary(ctx context.Context, mediaID string, ...) (*operations.UpdateMediaSummaryResponse, error)
- type InputVideo
- func (s *InputVideo) CreateMedia(ctx context.Context, request components.CreateMediaRequest, ...) (*operations.CreateMediaResponse, error)
- func (s *InputVideo) DirectUploadVideoMedia(ctx context.Context, request *operations.DirectUploadVideoMediaRequest, ...) (*operations.DirectUploadVideoMediaResponse, error)
- type LivePlayback
- func (s *LivePlayback) CreatePlaybackIDOfStream(ctx context.Context, streamID string, ...) (*operations.CreatePlaybackIDOfStreamResponse, error)
- func (s *LivePlayback) DeletePlaybackIDOfStream(ctx context.Context, streamID string, playbackID string, ...) (*operations.DeletePlaybackIDOfStreamResponse, error)
- func (s *LivePlayback) GetLiveStreamPlaybackID(ctx context.Context, streamID string, playbackID string, ...) (*operations.GetLiveStreamPlaybackIDResponse, error)
- type ManageLiveStream
- func (s *ManageLiveStream) CompleteLiveStream(ctx context.Context, streamID string, opts ...operations.Option) (*operations.CompleteLiveStreamResponse, error)
- func (s *ManageLiveStream) DeleteLiveStream(ctx context.Context, streamID string, opts ...operations.Option) (*operations.DeleteLiveStreamResponse, error)
- func (s *ManageLiveStream) DisableLiveStream(ctx context.Context, streamID string, opts ...operations.Option) (*operations.DisableLiveStreamResponse, error)
- func (s *ManageLiveStream) EnableLiveStream(ctx context.Context, streamID string, opts ...operations.Option) (*operations.EnableLiveStreamResponse, error)
- func (s *ManageLiveStream) GetAllStreams(ctx context.Context, limit *int64, offset *int64, orderBy *operations.OrderBy, ...) (*operations.GetAllStreamsResponse, error)
- func (s *ManageLiveStream) GetLiveStreamByID(ctx context.Context, streamID string, opts ...operations.Option) (*operations.GetLiveStreamByIDResponse, error)
- func (s *ManageLiveStream) GetLiveStreamViewerCountByID(ctx context.Context, streamID string, opts ...operations.Option) (*operations.GetLiveStreamViewerCountByIDResponse, error)
- func (s *ManageLiveStream) UpdateLiveStream(ctx context.Context, streamID string, ...) (*operations.UpdateLiveStreamResponse, error)
- type ManageVideos
- func (s *ManageVideos) AddMediaTrack(ctx context.Context, mediaID string, ...) (*operations.AddMediaTrackResponse, error)
- func (s *ManageVideos) CancelUpload(ctx context.Context, uploadID string, opts ...operations.Option) (*operations.CancelUploadResponse, error)
- func (s *ManageVideos) DeleteMedia(ctx context.Context, mediaID string, opts ...operations.Option) (*operations.DeleteMediaResponse, error)
- func (s *ManageVideos) DeleteMediaTrack(ctx context.Context, mediaID string, trackID string, opts ...operations.Option) (*operations.DeleteMediaTrackResponse, error)
- func (s *ManageVideos) GenerateSubtitleTrack(ctx context.Context, mediaID string, trackID string, ...) (*operations.GenerateSubtitleTrackResponse, error)
- func (s *ManageVideos) GetMedia(ctx context.Context, mediaID string, opts ...operations.Option) (*operations.GetMediaResponse, error)
- func (s *ManageVideos) GetMediaClips(ctx context.Context, sourceMediaID string, offset *int64, limit *int64, ...) (*operations.GetMediaClipsResponse, error)
- func (s *ManageVideos) ListLiveClips(ctx context.Context, livestreamID string, limit *int64, offset *int64, ...) (*operations.ListLiveClipsResponse, error)
- func (s *ManageVideos) ListMedia(ctx context.Context, limit *int64, offset *int64, ...) (*operations.ListMediaResponse, error)
- func (s *ManageVideos) ListUploads(ctx context.Context, limit *int64, offset *int64, ...) (*operations.ListUploadsResponse, error)
- func (s *ManageVideos) RetrieveMediaInputInfo(ctx context.Context, mediaID string, opts ...operations.Option) (*operations.RetrieveMediaInputInfoResponse, error)
- func (s *ManageVideos) UpdateMediaTrack(ctx context.Context, trackID string, mediaID string, ...) (*operations.UpdateMediaTrackResponse, error)
- func (s *ManageVideos) UpdatedMedia(ctx context.Context, mediaID string, ...) (*operations.UpdatedMediaResponse, error)
- func (s *ManageVideos) UpdatedMp4Support(ctx context.Context, mediaID string, ...) (*operations.UpdatedMp4SupportResponse, error)
- func (s *ManageVideos) UpdatedSourceAccess(ctx context.Context, mediaID string, ...) (*operations.UpdatedSourceAccessResponse, error)
- type Metrics
- func (s *Metrics) GetTimeseriesData(ctx context.Context, request operations.GetTimeseriesDataRequest, ...) (*operations.GetTimeseriesDataResponse, error)
- func (s *Metrics) ListBreakdownValues(ctx context.Context, request operations.ListBreakdownValuesRequest, ...) (*operations.ListBreakdownValuesResponse, error)
- func (s *Metrics) ListComparisonValues(ctx context.Context, timespan operations.ListComparisonValuesTimespan, ...) (*operations.ListComparisonValuesResponse, error)
- func (s *Metrics) ListOverallValues(ctx context.Context, metricID operations.ListOverallValuesMetricID, ...) (*operations.ListOverallValuesResponse, error)
- type Playback
- func (s *Playback) CreateMediaPlaybackID(ctx context.Context, mediaID string, ...) (*operations.CreateMediaPlaybackIDResponse, error)
- func (s *Playback) DeleteMediaPlaybackID(ctx context.Context, mediaID string, playbackID string, ...) (*operations.DeleteMediaPlaybackIDResponse, error)
- func (s *Playback) GetPlaybackID(ctx context.Context, mediaID string, playbackID string, ...) (*operations.GetPlaybackIDResponse, error)
- type Playlist
- func (s *Playlist) AddMediaToPlaylist(ctx context.Context, playlistID string, ...) (*operations.AddMediaToPlaylistResponse, error)
- func (s *Playlist) ChangeMediaOrderInPlaylist(ctx context.Context, playlistID string, ...) (*operations.ChangeMediaOrderInPlaylistResponse, error)
- func (s *Playlist) CreateAPlaylist(ctx context.Context, request components.CreatePlaylistRequest, ...) (*operations.CreateAPlaylistResponse, error)
- func (s *Playlist) DeleteAPlaylist(ctx context.Context, playlistID string, opts ...operations.Option) (*operations.DeleteAPlaylistResponse, error)
- func (s *Playlist) DeleteMediaFromPlaylist(ctx context.Context, playlistID string, ...) (*operations.DeleteMediaFromPlaylistResponse, error)
- func (s *Playlist) GetAllPlaylists(ctx context.Context, limit *int64, offset *int64, opts ...operations.Option) (*operations.GetAllPlaylistsResponse, error)
- func (s *Playlist) GetPlaylistByID(ctx context.Context, playlistID string, opts ...operations.Option) (*operations.GetPlaylistByIDResponse, error)
- func (s *Playlist) UpdateAPlaylist(ctx context.Context, playlistID string, ...) (*operations.UpdateAPlaylistResponse, error)
- type SDKOption
- func WithClient(client HTTPClient) SDKOption
- func WithRetryConfig(retryConfig retry.Config) SDKOption
- func WithSecurity(security components.Security) SDKOption
- func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption
- func WithServerIndex(serverIndex int) SDKOption
- func WithServerURL(serverURL string) SDKOption
- func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption
- func WithTimeout(timeout time.Duration) SDKOption
- type SigningKeys
- func (s *SigningKeys) CreateSigningKey(ctx context.Context, opts ...operations.Option) (*operations.CreateSigningKeyResponse, error)
- func (s *SigningKeys) DeleteSigningKey(ctx context.Context, signingKeyID string, opts ...operations.Option) (*operations.DeleteSigningKeyResponse, error)
- func (s *SigningKeys) GetSigningKeyByID(ctx context.Context, signingKeyID string, opts ...operations.Option) (*operations.GetSigningKeyByIDResponse, error)
- func (s *SigningKeys) ListSigningKeys(ctx context.Context, limit *float64, offset *float64, ...) (*operations.ListSigningKeysResponse, error)
- type SimulcastStream
- func (s *SimulcastStream) CreateSimulcastOfStream(ctx context.Context, streamID string, ...) (*operations.CreateSimulcastOfStreamResponse, error)
- func (s *SimulcastStream) DeleteSimulcastOfStream(ctx context.Context, streamID string, simulcastID string, ...) (*operations.DeleteSimulcastOfStreamResponse, error)
- func (s *SimulcastStream) GetSpecificSimulcastOfStream(ctx context.Context, streamID string, simulcastID string, ...) (*operations.GetSpecificSimulcastOfStreamResponse, error)
- func (s *SimulcastStream) UpdateSpecificSimulcastOfStream(ctx context.Context, streamID string, simulcastID string, ...) (*operations.UpdateSpecificSimulcastOfStreamResponse, error)
- type StartLiveStream
- type Views
- func (s *Views) GetDataViewlistCurrentViewsFilter(ctx context.Context, ...) (*operations.GetDataViewlistCurrentViewsFilterResponse, error)
- func (s *Views) GetDataViewlistCurrentViewsGetTimeseriesViews(ctx context.Context, opts ...operations.Option) (*operations.GetDataViewlistCurrentViewsGetTimeseriesViewsResponse, error)
- func (s *Views) GetVideoViewDetails(ctx context.Context, viewID string, opts ...operations.Option) (*operations.GetVideoViewDetailsResponse, error)
- func (s *Views) ListByTopContent(ctx context.Context, timespan operations.ListByTopContentTimespan, ...) (*operations.ListByTopContentResponse, error)
- func (s *Views) ListVideoViews(ctx context.Context, request operations.ListVideoViewsRequest, ...) (*operations.ListVideoViewsResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ServerList = []string{
"https://api.fastpix.io/v1/",
}
ServerList contains the list of servers available to the SDK
Functions ¶
Types ¶
type DRMConfigurations ¶ added in v1.0.0
type DRMConfigurations struct {
// contains filtered or unexported fields
}
func (*DRMConfigurations) GetDrmConfiguration ¶ added in v1.0.0
func (s *DRMConfigurations) GetDrmConfiguration(ctx context.Context, offset *int64, limit *int64, opts ...operations.Option) (*operations.GetDrmConfigurationResponse, error)
GetDrmConfiguration - Get list of DRM configuration IDs
This endpoint retrieves the DRM configuration (DRM ID) associated with a workspace. It returns a list of DRM configurations, identified by a unique DRM ID, which is used for creating DRM encrypted asset.
**How it works:** 1. Make a GET request to this endpoint. 2. Optionally use the `offset` and `limit` query parameters to paginate through the list of DRM configurations. 3. The response includes a list of DRM IDs and pagination metadata.
**Example:** A media service provider may retrieve DRM configuration for a workspace to create DRM content.
Related guide: <a href="https://docs.fastpix.io/docs/secure-playback-with-drm">Manage DRM configuration</a>
func (*DRMConfigurations) GetDrmConfigurationByID ¶ added in v1.0.0
func (s *DRMConfigurations) GetDrmConfigurationByID(ctx context.Context, drmConfigurationID string, opts ...operations.Option) (*operations.GetDrmConfigurationByIDResponse, error)
GetDrmConfigurationByID - Get DRM configuration by ID
This endpoint retrieves a DRM configuration ID. It is used to fetch the DRM-related ID for a workspace, typically required when validating or applying DRM policies to video assets.
**How it works:** 1. Make a GET request to this endpoint, replacing `{drmConfigurationId}` with the UUID of the DRM configuration. 2. The response will contain the associated DRM configuration ID.
Related guide: <a href="https://docs.fastpix.io/docs/secure-playback-with-drm">Manage DRM configuration</a>
type Dimensions ¶ added in v1.0.0
type Dimensions struct {
// contains filtered or unexported fields
}
func (*Dimensions) ListDimensions ¶ added in v1.0.0
func (s *Dimensions) ListDimensions(ctx context.Context, opts ...operations.Option) (*operations.ListDimensionsResponse, error)
ListDimensions - List the dimensions Retrieves a list of dimensions that can be used as query parameters across various data endpoints. Each dimension has a unique id that can be used to filter data effectively.
The dimensions retrieved from this endpoint can be used in conjunction with the <a href="https://docs.fastpix.io/reference/list_video_views">list video views</a> and <a href="https://docs.fastpix.io/reference/list_by_top_content">list by top content</a> endpoints to filter results based on specific criteria. For example, you can filter views by `browser_name`, `os_name`, `device_type`, and more.
Related guides: <a href="https://docs.fastpix.io/page/what-video-data-do-we-capture#/">What Video Data do we capture?</a> , <a href="https://docs.fastpix.io/docs/user-passable-metadata-1">Use passable dimensions</a>
func (*Dimensions) ListFilterValuesForDimension ¶ added in v1.0.0
func (s *Dimensions) ListFilterValuesForDimension(ctx context.Context, dimensionsID operations.DimensionsID, timespan operations.ListFilterValuesForDimensionTimespan, filterby *string, opts ...operations.Option) (*operations.ListFilterValuesForDimensionResponse, error)
ListFilterValuesForDimension - List the filter values for a dimension This endpoint returns the filter values associated with a specific dimension, along with the total number of video views for each value. For example, it can list all `browser_name` (dimension) and show how many views occurred for all available browsers like Chrome, Safari (filter values).
In order to use the <a href="https://docs.fastpix.io/docs/custom-business-metadata">Custom Dimensions</a>, you must enable them in the dashboard under settings option based on the plan you have opted for.
#### Example
A developer wants to know how their video content performs across different browsers. By calling this endpoint for the `device_type` dimension, they can retrieve a breakdown of video views by each device (e.g., Desktop, Mobile, Tablet). This data will help the developer understand where optimizations or troubleshooting may be necessary.
Related guide: <a href="https://docs.fastpix.io/docs/understand-dashboard-ui#filters-and-timeframes">Filters and timeframes</a>
type Errors ¶ added in v1.0.0
type Errors struct {
// contains filtered or unexported fields
}
func (*Errors) ListErrors ¶ added in v1.0.0
func (s *Errors) ListErrors(ctx context.Context, timespan operations.ListErrorsTimespan, filterby *string, limit *int64, opts ...operations.Option) (*operations.ListErrorsResponse, error)
ListErrors - List errors This endpoint returns the total number of playback errors that occurred, along with the total number of views captured, based on the specified timespan and filters. It provides insights into the overall playback quality and helps identify potential issues that may impact viewer experience.
#### Key fields in response
* **percentage:** The percentage of views affected by the specific error. * **uniqueViewersEffectedPercentage:** The percentage of unique viewers affected by the specific error (available only in the topErrors section). * **notes:** Additional notes or information about the specific error. * **message:** The error message or description. * **lastSeen:** The timestamp of when the error was last observed. * **id:** The unique identifier for the specific error. * **description:** A description of the specific error. * **count:** The number of occurrences of the specific error. * **code:** The error code associated with the specific error.
Related guide: <a href="https://docs.fastpix.io/docs/track-playback-errors">Troubleshoot errors</a>
type Fastpixgo ¶ added in v1.0.0
type Fastpixgo struct {
SDKVersion string
InputVideo *InputVideo
ManageVideos *ManageVideos
InVideoAIFeatures *InVideoAIFeatures
Playback *Playback
Playlist *Playlist
DRMConfigurations *DRMConfigurations
StartLiveStream *StartLiveStream
ManageLiveStream *ManageLiveStream
LivePlayback *LivePlayback
SimulcastStream *SimulcastStream
SigningKeys *SigningKeys
Views *Views
Dimensions *Dimensions
Metrics *Metrics
Errors *Errors
// contains filtered or unexported fields
}
Fastpixgo - FASTPIX API'S: FastPix provides a comprehensive set of APIs that enable developers to manage both **on-demand media (video/audio)** and **live streaming experiences**, with built-in security features through **cryptographic signing keys**. These APIs cover the full lifecycle of content creation, management, distribution, playback, and secure access, making them ideal for building scalable video-first applications. ### Media APIs (Video & Audio on Demand) The **Media APIs** allow developers to create, retrieve, update, and delete media files, as well as manage metadata, playback settings, and additional tracks such as audio or subtitles. With these endpoints, developers can: - Upload videos directly or create media from URLs. - Manage playback permissions and configure playback IDs. - Add multilingual audio or subtitle tracks for global audiences. - Build robust video-on-demand (VOD) and audio-on-demand (AOD) libraries. **Use case scenarios** - **Video-on-Demand Platforms:** Manage large content libraries for streaming services. - **E-Learning Solutions:** Upload and organize lecture videos, metadata, and playback settings. - **Multilingual Content Delivery:** Add multiple language tracks or subtitles to serve global users. ### Live Stream APIs The **Live Stream APIs** simplify the process of creating, managing, and distributing live content. Developers can initiate broadcasts, configure stream settings, and extend streams to external platforms through simulcasting. These endpoints also support real-time interaction and customization of live events. - Start and manage live broadcasts programmatically. - Control stream metadata, privacy, and playback options. - Simulcast to platforms like YouTube, Facebook, or Twitch. - Update stream details and manage live playback IDs in real time. **Use case scenarios** - **Event Broadcasting:** Enable organizers to set up live streams for conferences, concerts, or webinars. - **Creator Platforms:** Provide streamers with tools for broadcasting gameplay, tutorials, or vlogs with simulcasting support. - **Corporate Streaming:** Deliver secure internal town halls or meetings with privacy and playback controls. ### Video Data APIs The **Video Data APIs** Provide insights into viewer interactions, performance metrics, and playback errors to optimize content delivery and user experience.
Track video views, unique viewers, and engagement metrics
Identify top-performing content and usage patterns
Break down data by browser, device, or geography
Detect playback errors and performance issues
Enable data-driven content strategy decisions
**Use case scenarios**
Analytics Dashboards: Monitor performance across content libraries
Quality Monitoring: Diagnose and resolve playback issues
Content Strategy Optimization: Identify high-value content
User Behavior Insights: Understand audience interactions
### Signing Keys FastPix also provides endpoints for managing **cryptographic signing keys**, which are essential for securely signing and verifying tokens, such as JSON Web Tokens (JWTs). These keys are critical for authenticating and authorizing API requests, as well as for protecting access to media assets. - **Private key:** Used to create digital signatures (kept secret). - **Public key:** Used to verify digital signatures (shared for verification). By rotating and managing signing keys regularly, developers can maintain strong security practices and prevent unauthorized access. **Use case scenarios** - **Token-based authentication:** Validate user access to premium or subscription-based content. - **Key rotation:** Regularly rotate keys to reduce risk of compromise. - **Protect intellectual property:** Prevent unauthorized distribution of valuable media assets. - **Control usage:** Restrict access to specific users, groups, or contexts. - **Prevent tampering:** Ensure requested assets have not been modified. - **Time-bound access:** Enable signed URLs with expiration for controlled viewing windows.
type HTTPClient ¶
HTTPClient provides an interface for supplying the SDK with a custom HTTP client
type InVideoAIFeatures ¶ added in v1.0.0
type InVideoAIFeatures struct {
// contains filtered or unexported fields
}
func (*InVideoAIFeatures) UpdateMediaChapters ¶ added in v1.0.0
func (s *InVideoAIFeatures) UpdateMediaChapters(ctx context.Context, mediaID string, requestBody operations.UpdateMediaChaptersRequestBody, opts ...operations.Option) (*operations.UpdateMediaChaptersResponse, error)
UpdateMediaChapters - Generate video chapters This endpoint enables you to generate chapters for an existing media file.
#### How it works 1. Make a `PATCH` request to this endpoint, replacing `<mediaId>` with the ID of the media for which you want to generate chapters. 2. Include the `chapters` parameter in the request body to enable. 3. The response will contain the updated media data, confirming the changes made.
You can use the <a href="https://docs.fastpix.io/docs/ai-events#videomediaaichaptersready">video.mediaAI.chapters.ready</a> webhook event to track and notify about the chapters generation.
**Use case:** This is particularly useful when a user uploads a video and later decides to enable chapters without re-uploading the entire video.
Related guide: <a href="https://docs.fastpix.io/reference/update-media-chapters">Video chapters</a>
func (*InVideoAIFeatures) UpdateMediaModeration ¶ added in v1.0.0
func (s *InVideoAIFeatures) UpdateMediaModeration(ctx context.Context, mediaID string, requestBody operations.UpdateMediaModerationRequestBody, opts ...operations.Option) (*operations.UpdateMediaModerationResponse, error)
UpdateMediaModeration - Enable video moderation This endpoint enables moderation features, such as NSFW and profanity filtering, to detect inappropriate content in existing media.
#### How it works 1. Make a PATCH request to this endpoint, replacing `<mediaId>` with the ID of the media you want to update. 2. Include the `moderation` object and provide the requried `type` parameter in the request body to specify the media type (e.g., video/audio/av). 4. The response will contain the updated media data, confirming the changes made.
You can use the <a href="https://docs.fastpix.io/docs/ai-events#videomediaaimoderationready">video.mediaAI.moderation.ready</a> webhook event to track and notify about the detected moderation results.
**Use case:** This is particularly useful when a user uploads a video and later decides to enable moderation detection without the need to re-upload it.
Related guide: <a href="https://docs.fastpix.io/docs/using-nsfw-and-profanity-filter-for-video-moderation">Moderate NSFW & Profanity</a>
func (*InVideoAIFeatures) UpdateMediaNamedEntities ¶ added in v1.0.0
func (s *InVideoAIFeatures) UpdateMediaNamedEntities(ctx context.Context, mediaID string, requestBody operations.UpdateMediaNamedEntitiesRequestBody, opts ...operations.Option) (*operations.UpdateMediaNamedEntitiesResponse, error)
UpdateMediaNamedEntities - Generate named entities This endpoint allows you to extract named entities from an existing media. Named Entity Recognition (NER) is a fundamental natural language processing (NLP) technique that identifies and classifies key information (entities) in text into predefined categories. For instance:
- Organizations (e.g., "Microsoft", "United Nations")
- Locations (e.g., "Paris", "Mount Everest")
- Product names (e.g., "iPhone", "Coca-Cola")
#### How it works 1. Make a PATCH request to this endpoint, replacing `<mediaId>` with the ID of the media you want to extract named-entities. 2. Include the `namedEntities` parameter in the request body to enable. 3. Receive a response containing the updated media data, confirming the changes made.
You can use the <a href="https://docs.fastpix.io/docs/ai-events#videomediaainamedentitiesready">video.mediaAI.named-entities.ready</a> webhook event to track and notify about the named entities extraction.
**Use case:** If a user uploads a video and later decides to enable named entity extraction without re-uploading the entire video.
Related guide: <a href="https://docs.fastpix.io/docs/generate-named-entities">Named entities</a>
func (*InVideoAIFeatures) UpdateMediaSummary ¶ added in v1.0.0
func (s *InVideoAIFeatures) UpdateMediaSummary(ctx context.Context, mediaID string, requestBody operations.UpdateMediaSummaryRequestBody, opts ...operations.Option) (*operations.UpdateMediaSummaryResponse, error)
UpdateMediaSummary - Generate video summary This endpoint allows you to generate the summary for an existing media.
#### How it works 1. Send a PATCH request to this endpoint, replacing `<mediaId>` with the unique ID of the media for which you wish to generate a summary. 2. Include the `generate` parameter in the request body. 3. Include the `summaryLength` parameter, specify the desired length of the summary in words (e.g., 120 words), this determines how concise or detailed the summary will be. If no specific summary length is provided, the default length will be 100 words. 4. The response will include the updated media data and confirmation of the changes applied.
You can use the <a href="https://docs.fastpix.io/docs/ai-events#videomediaaisummaryready">video.mediaAI.summary.ready</a> webhook event to track and notify about the summary generation.
**Use case**: This is particularly useful when a user uploads a video and later chooses to generate a summary without needing to re-upload the video.
Related guide: <a href="https://docs.fastpix.io/docs/generate-video-summary">Video summary</a>
type InputVideo ¶
type InputVideo struct {
// contains filtered or unexported fields
}
func (*InputVideo) CreateMedia ¶
func (s *InputVideo) CreateMedia(ctx context.Context, request components.CreateMediaRequest, opts ...operations.Option) (*operations.CreateMediaResponse, error)
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 this 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 <a href="https://docs.fastpix.io/reference/get-media">Get Media by ID</a> 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 <a href="https://docs.fastpix.io/docs/media-events#videomediacreated">video.media.created</a>.
Once processing is done you can look for the events <a href="https://docs.fastpix.io/docs/media-events#/videomediaready">video.media.ready<a/> and <a href="https://docs.fastpix.io/docs/media-events#videomediafailed">video.media.failed</a> to see the status of your new media file.
Related guide: <a href="https://docs.fastpix.io/docs/upload-videos-from-url">Upload videos from URL</a>
func (*InputVideo) DirectUploadVideoMedia ¶
func (s *InputVideo) DirectUploadVideoMedia(ctx context.Context, request *operations.DirectUploadVideoMediaRequest, opts ...operations.Option) (*operations.DirectUploadVideoMediaResponse, error)
DirectUploadVideoMedia - Upload media from device This endpoint enables accelerated uploads of large media files directly from your local device to FastPix for processing and storage.
> **PLEASE NOTE** > > This version now supports uploads with no file size limitations and offers faster uploads. The previous endpoint (which had a 500MB size limit) is now deprecated. You can find details in the [changelog](https://docs.fastpix.io/changelog/api-update-direct-upload-media-from-device).
#### How it works
1. Send a POST request to this endpoint with optional media settings.
2. The response includes an `uploadId` and a 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 <a href="https://docs.fastpix.io/reference/get-media">Get Media by ID</a> 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 <a href="https://docs.fastpix.io/docs/webhooks-collection#media-related-events">media related events</a>.
#### Example
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.
Related guide: <a href="https://docs.fastpix.io/docs/upload-videos-directly">Upload videos directly</a>
type LivePlayback ¶ added in v1.0.0
type LivePlayback struct {
// contains filtered or unexported fields
}
func (*LivePlayback) CreatePlaybackIDOfStream ¶ added in v1.0.0
func (s *LivePlayback) 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. #### Example 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 (*LivePlayback) DeletePlaybackIDOfStream ¶ added in v1.0.0
func (s *LivePlayback) 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.
#### Example 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 (*LivePlayback) GetLiveStreamPlaybackID ¶ added in v1.0.0
func (s *LivePlayback) GetLiveStreamPlaybackID(ctx context.Context, streamID string, playbackID string, opts ...operations.Option) (*operations.GetLiveStreamPlaybackIDResponse, error)
GetLiveStreamPlaybackID - Get playbackId details Retrieves details about a previously created playback ID. If you provide the distinct `playbackId` that was given back to you in the previous stream or <a href="https://docs.fastpix.io/reference/create-playbackid-of-stream">create playbackId</a> request, FastPix will provide the relevant playback details such as the access policy.
#### Example A developer needs to confirm the access policy of the playback ID to ensure whether the stream is public or private for viewers.
type ManageLiveStream ¶
type ManageLiveStream struct {
// contains filtered or unexported fields
}
func (*ManageLiveStream) CompleteLiveStream ¶ added in v1.0.0
func (s *ManageLiveStream) CompleteLiveStream(ctx context.Context, streamID string, opts ...operations.Option) (*operations.CompleteLiveStreamResponse, error)
CompleteLiveStream - Complete a stream This endpoint marks a livestream as completed by stopping the active stream and transitioning its status to `idle`. It is typically used after a livestream session has ended.
This operation only works when the stream is in the `active` state.
Completing a stream can help finalize the session and trigger post-processing events like VOD generation.
#### Example
A virtual event ends, and the system or host needs to close the livestream to prevent further streaming. This endpoint ensures the livestream status is changed from `active` to `idle`, indicating it's officially completed.
Related guide <a href="https://docs.fastpix.io/docs/manage-streams">Manage streams</a>
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 <a href="https://docs.fastpix.io/docs/live-events#videolive_streamdeleted">video.live_stream.deleted</a> 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. Related guide: <a href="https://docs.fastpix.io/docs/manage-streams">Manage streams</a>
func (*ManageLiveStream) DisableLiveStream ¶ added in v1.0.0
func (s *ManageLiveStream) DisableLiveStream(ctx context.Context, streamID string, opts ...operations.Option) (*operations.DisableLiveStreamResponse, error)
DisableLiveStream - Disable a stream This endpoint disables a livestream by setting its status to `disabled`. Use this to stop a livestream when it's no longer needed or should be taken offline intentionally.
A disabled stream can later be re-enabled using the enable endpoint — however, if you're on a trial plan, re-enabling is not allowed once the stream is disabled.
#### Example
A speaker finishes their live session and wants to prevent the stream from being mistakenly started again. By calling this endpoint, the stream is transitioned to a `disabled` state, ensuring it's permanently stopped (unless re-enabled on a paid plan).
Related guide <a href="https://docs.fastpix.io/docs/manage-streams">Manage streams</a>
func (*ManageLiveStream) EnableLiveStream ¶ added in v1.0.0
func (s *ManageLiveStream) EnableLiveStream(ctx context.Context, streamID string, opts ...operations.Option) (*operations.EnableLiveStreamResponse, error)
EnableLiveStream - Enable a stream This endpoint allows you to enable a livestream by transitioning its status from `disabled` to `idle`. Once enabled, the stream becomes available and ready to accept an incoming broadcast from a streaming tool.
Streams on the trial plan cannot be re-enabled if they are in the `disabled` state.
The `livestreamId` must be provided in the path, and the stream must not already be in an enabled state (`idle`, `preparing`, or `active`).
#### Example
A creator disables a livestream to pause it temporarily. Later, they decide to continue the session. By calling this endpoint with the stream's ID, they can re-enable and restart the same livestream.
Related guide <a href="https://docs.fastpix.io/docs/manage-streams">Manage streams</a>
func (*ManageLiveStream) GetAllStreams ¶
func (s *ManageLiveStream) GetAllStreams(ctx context.Context, limit *int64, offset *int64, orderBy *operations.OrderBy, opts ...operations.Option) (*operations.GetAllStreamsResponse, error)
GetAllStreams - Get all live streams Retrieves a list of all live streams associated with the current workspace. It provides an overview of both current and past live streams, including details like `streamId`, `metadata`, `status`, `createdAt` and more.
#### How it works
Use the access token and secret key related to the workspace in the request header. When called, the API provides a paginated response containing all the live streams in that specific workspace. This is helpful for retrieving a large volume of streams and managing content in bulk.
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 details 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. #### 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.
Related guide: <a href="https://docs.fastpix.io/docs/manage-streams">Manage streams</a>
func (*ManageLiveStream) GetLiveStreamViewerCountByID ¶ added in v1.0.0
func (s *ManageLiveStream) GetLiveStreamViewerCountByID(ctx context.Context, streamID string, opts ...operations.Option) (*operations.GetLiveStreamViewerCountByIDResponse, error)
GetLiveStreamViewerCountByID - Get stream views by ID This endpoint retrieves the current number of viewers watching a specific live stream, identified by its unique `streamId`.
The viewer count is an **approximate value**, optimized for performance. It provides a near-real-time estimate of how many clients are actively watching the stream. This approach ensures high efficiency, especially when the stream is being watched at large scale across multiple devices or platforms.
#### Example
Suppose a content creator is hosting a live concert and wants to display the number of live viewers on their dashboard. This endpoint can be queried to show up-to-date viewer statistics.
Related guide: <a href="https://docs.fastpix.io/docs/manage-streams">Manage streams</a>
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 you to modify the parameters of an existing live stream, such as its `metadata` (title, description) or the `reconnectWindow`. 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, <a href="https://docs.fastpix.io/docs/live-events#videolive_streamupdated">video.live_stream.updated</a> webhook event notifies your system. #### 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. Related guide: <a href="https://docs.fastpix.io/docs/manage-streams">Manage streams</a>
type ManageVideos ¶
type ManageVideos struct {
// contains filtered or unexported fields
}
func (*ManageVideos) AddMediaTrack ¶ added in v1.0.0
func (s *ManageVideos) AddMediaTrack(ctx context.Context, mediaID string, requestBody operations.AddMediaTrackRequestBody, opts ...operations.Option) (*operations.AddMediaTrackResponse, error)
AddMediaTrack - Add audio / subtitle track This endpoint allows you to add an audio or subtitle track to an existing media file using its `mediaId`. You need to provide the track `url` along with its `type` (audio or subtitle), `languageName` and `languageCode` in the request payload.
#### How it works
1. Send a POST request to this endpoint, replacing `{mediaId}` with the media ID (`uploadId` or `id`).
2. Provide the necessary details in the request body.
3. Receive a response containing a unique track ID and the details of the newly added track.
#### Webhook events
1. After successfully adding a track, your system will receive the webhook event <a href="https://docs.fastpix.io/docs/transform-media-events#videomediatrackcreated">video.media.track.created</a>.
2. Once the track is processed and ready, you will receive the webhook event <a href="https://docs.fastpix.io/docs/transform-media-events#videomediatrackready">video.media.track.ready</a>.
3. Finally, an update event <a href="https://docs.fastpix.io/docs/media-events#videomediaupdated">video.media.updated</a> will notify your system about the media's updated status.
#### Example Suppose you have a video uploaded to the FastPix platform, and you want to add an Italian audio track to it. By calling this API, you can attach an external audio file (https://static.fastpix.io/music-1.mp3) to the media file. Similarly, if you need to add subtitles in different languages, you can specify type: `subtitle` with the corresponding subtitle `url`, `languageCode` and `languageName`.
Related guides: <a href="https://docs.fastpix.io/docs/manage-subtitle-tracks">Add own subtitle tracks</a>, <a href="https://docs.fastpix.io/docs/manage-audio-tracks">Add own audio tracks</a>
func (*ManageVideos) CancelUpload ¶ added in v1.0.0
func (s *ManageVideos) CancelUpload(ctx context.Context, uploadID string, opts ...operations.Option) (*operations.CancelUploadResponse, error)
CancelUpload - Cancel ongoing upload This endpoint allows you to cancel ongoing upload by its `uploadId`. Once cancelled, the upload will be marked as cancelled. Use this if a user aborts an upload or if you want to programmatically stop an in-progress upload.
#### How it works
1. Make a PUT request to this endpoint, replacing `{uploadId}` with the unique upload ID received after starting the upload. 2. The response will confirm the cancellation and provide the status of the upload.
#### Webhook Events
Once the upload is cancelled, you will receive the webhook event <a href="https://docs.fastpix.io/docs/media-events#videomediauploadcancelled-event">video.media.upload.cancelled</a>.
#### Example
Suppose a user starts uploading a large video file but decides to cancel before completion. By calling this API, you can immediately stop the upload and free up resources.
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 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 this endpoint, replacing `<mediaId>` with the `uploadId` or the `id` of the media you want to delete.
2. 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: <a href="https://docs.fastpix.io/docs/media-events#videomediadeleted">video.media.deleted</a>
#### Example 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) DeleteMediaTrack ¶ added in v1.0.0
func (s *ManageVideos) DeleteMediaTrack(ctx context.Context, mediaID string, trackID string, opts ...operations.Option) (*operations.DeleteMediaTrackResponse, error)
DeleteMediaTrack - Delete audio / subtitle track This endpoint allows you to delete an existing audio or subtitle track from a media file. Once deleted, the track will no longer be available for playback.
#### How it works
1. Send a DELETE request to this endpoint, replacing `{mediaId}` with the media ID, and `{trackId}` with the ID of the track you want to remove.
2. The track will be deleted from the media file, and you will receive a confirmation response.
#### Webhook events
1. After successfully deleting a track, your system will receive the webhook event **video.media.track.deleted**.
2. Once the media file is updated to reflect the track removal, a <a href="https://docs.fastpix.io/docs/media-events#videomediaupdated">video.media.updated</a> event will be triggered.
#### Example Suppose you uploaded an audio track in Italian for a video but later realize it's incorrect or no longer needed. By calling this API, you can remove the specific track while keeping the rest of the media file unchanged. This is useful when:
- A track was mistakenly added and needs to be removed.
- The content owner requests the removal of a specific subtitle or audio track.
- A new version of the track will be uploaded to replace the existing one.
Related guides: <a href="https://docs.fastpix.io/docs/manage-subtitle-tracks">Add own subtitle tracks</a>, <a href="https://docs.fastpix.io/docs/manage-audio-tracks">Add own audio tracks</a>
func (*ManageVideos) GenerateSubtitleTrack ¶ added in v1.0.0
func (s *ManageVideos) GenerateSubtitleTrack(ctx context.Context, mediaID string, trackID string, trackSubtitlesGenerateRequest components.TrackSubtitlesGenerateRequest, opts ...operations.Option) (*operations.GenerateSubtitleTrackResponse, error)
GenerateSubtitleTrack - Generate track subtitle This endpoint allows you to generate subtitles for an existing audio track in a media file. By calling this API, you can generate subtitles automatically using speech recognition
#### How it works
1. Send a `POST` request to this endpoint, replacing `{mediaId}` with the media ID and `{trackId}` with the track ID.
2. Provide the necessary details in the request body, including the languageName and languageCode.
3. Receive a response containing a unique subtitle track ID and its details.
#### Webhook Events
1. Once the subtitle track is generated and ready, you will receive the webhook event <a href="https://docs.fastpix.io/docs/transform-media-events#videomediasubtitlegeneratedready">video.media.subtitle.generated.ready</a>.
2. Finally, an update event <a href="https://docs.fastpix.io/docs/media-events#videomediaupdated">video.media.updated</a> will notify your system about the media's updated status.
</br> Related guide: <a href="https://docs.fastpix.io/docs/add-auto-generated-subtitles-to-videos">Add auto-generated subtitles</a>
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 this endpoint, using the `<mediaId>` received after uploading the media file.
2. Receive a response that includes details about the media:
* `status` Indicates whether the media is still `preparing` or has transitioned to `ready`.
* The `playbackId` is a unique identifier that allows you to stream the media once it is `ready`. You can construct the stream URL in this format: `https://stream.fastpix.io/<playbackId>.m3u8`
#### Example
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) GetMediaClips ¶ added in v1.0.0
func (s *ManageVideos) GetMediaClips(ctx context.Context, sourceMediaID string, offset *int64, limit *int64, orderBy *components.SortOrder, opts ...operations.Option) (*operations.GetMediaClipsResponse, error)
GetMediaClips - Get all clips of a media This endpoint retrieves a list of all media clips associated with a given source media ID. It helps in organizing and managing media's efficiently by providing metadata, including clip media IDs and other relevant details.
A media clip is a segmented portion of an original media file (source media). Clips are often created for various purposes such as previews, highlights, or customized edits. This API allows you to fetch all such clips linked to a specific source media, making it easier to track and manage clips.
#### How it works
- The endpoint returns metadata for all media clips associated with the given `sourceMediaId`. - Results are paginated to efficiently handle large datasets. - Each entry includes detailed metadata such as media `id`, `duration`, and `status`. - Helps in organizing clips effectively by providing structured information.
#### Example
Imagine you're managing a video editing platform where users upload full-length videos and create short clips for social media sharing. To keep track of all clips linked to a particular video, you call this API with the sourceMediaId. The response provides a list of all associated clips, allowing you to manage, edit, or repurpose them as needed.
Related guide: <a href="https://docs.fastpix.io/docs/create-clips-from-existing-media">Create clips from existing media</a>
func (*ManageVideos) ListLiveClips ¶ added in v1.0.0
func (s *ManageVideos) ListLiveClips(ctx context.Context, livestreamID string, limit *int64, offset *int64, orderBy *components.SortOrder, opts ...operations.Option) (*operations.ListLiveClipsResponse, error)
ListLiveClips - Get all clips of a live stream Retrieves a list of all media clips generated from a specific livestream. Each media entry includes metadata such as the clip media IDs, and other relevant details. A media clip is a segmented portion of an original media file (source live stream). Clips are often created for various purposes such as previews, highlights, or customized edits. #### How it works To use this endpoint, provide the `livestreamId` as a parameter. The API then returns a paginated list of clipped media items created from that livestream. Pagination ensures optimal performance and usability when dealing with a large number of media files, making it easier to organize and manage content in bulk.
Related guide: <a href="https://docs.fastpix.io/docs/instant-live-clipping">Instant live clipping</a>
func (*ManageVideos) ListMedia ¶
func (s *ManageVideos) ListMedia(ctx context.Context, limit *int64, offset *int64, orderBy *components.SortOrder, opts ...operations.Option) (*operations.ListMediaResponse, error)
ListMedia - Get list of all media This endpoint returns a list of all media files uploaded to FastPix within a specific workspace. Each media entry contains data such as the media `id`, `createdAt`, `status`, `type` and more. It allows you to retrieve an overview of your media assets, making it easier to manage and review them.
#### How it works
Use the access token and secret key related to the workspace in the request header. When called, the API provides a paginated response containing all the media items in that specific workspace. This is helpful for retrieving a large volume of media and managing content in bulk.
#### 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) ListUploads ¶ added in v1.0.0
func (s *ManageVideos) ListUploads(ctx context.Context, limit *int64, offset *int64, orderBy *components.SortOrder, opts ...operations.Option) (*operations.ListUploadsResponse, error)
ListUploads - Get all unused upload URLs This endpoint retrieves a paginated list of all unused upload signed URLs within your organization. It provides comprehensive metadata including upload IDs, creation dates, status, and URLs, helping you manage your media resources efficiently.
An unused upload URL is a signed URL that gets generated when an user initiates upload but never completed the upload process. This can happen due to reasons like network issues, manual cancellation of upload, browser/app crashes or session timeouts.These URLs remain in the system as "unused" since they were created but never resulted in a successful media file upload.
#### How it works
- The endpoint returns metadata for all unused upload URLs in your organization's library.
- Results are paginated to manage large datasets effectively.
- Signed URLs expire after 24 hours from creation.
- Each entry includes full metadata about the unused upload.
#### Example
A video management team for a media organization regularly uploads content to their system but often forgets to delete or utilize unused uploads. These unused uploads, which have signed URLs that expire after 24 hours, need to be managed efficiently. By using this API, they can retrieve metadata for all unused uploads, identify expired signed URLs, and decide whether to regenerate URLs, reuse the uploads, or delete them.
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 with:
* The public storage input `url` of the uploaded media file.
* Information about the `tracks` associated with the media, including both video and audio tracks, indicating whether they have been successfully created.
* 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) UpdateMediaTrack ¶ added in v1.0.0
func (s *ManageVideos) UpdateMediaTrack(ctx context.Context, trackID string, mediaID string, updateTrackRequest components.UpdateTrackRequest, opts ...operations.Option) (*operations.UpdateMediaTrackResponse, error)
UpdateMediaTrack - Update audio / subtitle track This endpoint allows you to update an existing audio or subtitle track associated with a media file. When updating a track, you must provide the new track `url`, `languageName`, and `languageCode`, ensuring all three parameters are included in the request.
#### How it works
1. Send a PATCH request to this endpoint, replacing `{mediaId}` with the media ID, and `{trackId}` with the ID of the track you want to update.
2. Provide the necessary details in the request body.
3. Receive a response confirming the track update.
#### Webhook Events
After updating a track, your system will receive webhook notifications:
1. After successfully updating a track, your system will receive the webhook event <a href="https://docs.fastpix.io/docs/transform-media-events#videomediatrackupdated">video.media.track.updated</a>.
2. Once the new track is processed and ready, you will receive the webhook event <a href="https://docs.fastpix.io/docs/transform-media-events#videomediatrackready">video.media.track.ready</a>.
3. Once the media file is updated with the new track details, a <a href="https://docs.fastpix.io/docs/media-events#videomediaupdated">video.media.updated</a> event will be triggered.
#### Example Suppose you previously added a French subtitle track to a video but now need to update it with a different file. By calling this API, you can replace the existing subtitle file (.vtt) with a new one while keeping the same track ID. This is useful when:
- The original track file has errors and needs correction.
- You want to improve subtitle translations or replace an audio track with a better-quality version.
Related guides: <a href="https://docs.fastpix.io/docs/manage-subtitle-tracks">Add own subtitle tracks</a>, <a href="https://docs.fastpix.io/docs/manage-audio-tracks">Add own audio tracks</a>
func (*ManageVideos) UpdatedMedia ¶
func (s *ManageVideos) UpdatedMedia(ctx context.Context, mediaID string, requestBody operations.UpdatedMediaRequestBody, opts ...operations.Option) (*operations.UpdatedMediaResponse, error)
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 directly from device.
#### How it works
1. Make a PATCH request to this endpoint, replacing `<mediaId>` with the unique ID (`uploadId` or `id`) of the media received after uploading to FastPix.
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 <a href="https://docs.fastpix.io/docs/media-events#videomediaupdated">video.media.updated</a> to notify your system about update status.
#### Example 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.
func (*ManageVideos) UpdatedMp4Support ¶ added in v1.0.0
func (s *ManageVideos) UpdatedMp4Support(ctx context.Context, mediaID string, requestBody operations.UpdatedMp4SupportRequestBody, opts ...operations.Option) (*operations.UpdatedMp4SupportResponse, error)
UpdatedMp4Support - Update the mp4Support of a media by ID This endpoint allows you to update the `mp4Support` setting of an existing media file using its media ID. You can specify the MP4 support level, such as `none`, `capped_4k`, `audioOnly`, or a combination of `audioOnly`, `capped_4k`, in the request payload.
#### How it works
1. Send a PATCH request to this endpoint, replacing `{mediaId}` with the media ID.
2. Provide the desired `mp4Support` value in the request body.
3. Receive a response confirming the update, including the media's updated MP4 support status.
#### MP4 Support Options
- `none` – MP4 support is disabled for this media.
- `capped_4k` – The media will have mp4 renditions up to 4K resolution.
- `audioOnly` – The media will generate an m4a file containing only the audio track.
- `audioOnly,capped_4k` – The media will have both an audio-only m4a file and mp4 renditions up to 4K resolution.
#### Webhook events
- <a href="https://docs.fastpix.io/docs/transform-media-events#videomediamp4supportready">video.media.mp4Support.ready</a> – Triggered when the MP4 support setting is successfully updated.
#### Example Suppose you have a video uploaded to the FastPix platform, and you want to allow users to download the video in MP4 format. By setting "mp4Support": "capped_4k", the system will generate an MP4 rendition of the video up to 4K resolution, making it available for download via the stream URL(`https://stream.fastpix.io/{playbackId}/{capped-4k.mp4 | audio.m4a}`). If you want users to stream only the audio from the media file, you can set "mp4Support": "audioOnly". This will provide an audio-only stream URL that allows users to listen to the media without video. By setting "mp4Support": "audioOnly,capped_4k", both options will be enabled. Users will be able to download the MP4 video and also stream just the audio version of the media.
Related guide: <a href="https://docs.fastpix.io/docs/mp4-support-for-offline-viewing">Use MP4 support for offline viewing</a>
func (*ManageVideos) UpdatedSourceAccess ¶ added in v1.0.0
func (s *ManageVideos) UpdatedSourceAccess(ctx context.Context, mediaID string, requestBody operations.UpdatedSourceAccessRequestBody, opts ...operations.Option) (*operations.UpdatedSourceAccessResponse, error)
UpdatedSourceAccess - Update the source access of a media by ID This endpoint allows you to update the `sourceAccess` setting of an existing media file. The `sourceAccess` parameter determines whether the original media file is accessible or restricted. Setting this to `true` enables access to the media source, while setting it to `false` restricts access.
#### How it works
1. Make a `PATCH` request to this endpoint, replacing `{mediaId}` with the ID of the media you want to update.
2. Include the updated `sourceAccess` parameter in the request body.
3. Receive a response confirming the update to the media's source access status. 4. Webhook events: <a href="https://docs.fastpix.io/docs/transform-media-events#videomediasourceready">video.media.source.ready</a>, <a href="https://docs.fastpix.io/docs/transform-media-events#videomediasourcedeleted">video.media.source.deleted</a>
type Metrics ¶ added in v1.0.0
type Metrics struct {
// contains filtered or unexported fields
}
func (*Metrics) GetTimeseriesData ¶ added in v1.0.0
func (s *Metrics) GetTimeseriesData(ctx context.Context, request operations.GetTimeseriesDataRequest, opts ...operations.Option) (*operations.GetTimeseriesDataResponse, error)
GetTimeseriesData - Get timeseries data This endpoint retrieves timeseries data for a specified metric, providing insights into how the metric values change over time. The response includes an array of data points, each representing the metric's value at specific intervals.
Each data point contains the following fields:
* **intervalTime:** The timestamp for the data point indicating when the metric value was recorded. * **metricValue:** The value of the specified metric at the given interval, reflecting the performance or engagement level during that time. * **numberOfViews:** The total number of views recorded during that interval, providing context for the metric value.
func (*Metrics) ListBreakdownValues ¶ added in v1.0.0
func (s *Metrics) ListBreakdownValues(ctx context.Context, request operations.ListBreakdownValuesRequest, opts ...operations.Option) (*operations.ListBreakdownValuesResponse, error)
ListBreakdownValues - List breakdown values Retrieves breakdown values for a specified metric and timespan, allowing you to analyze the performance of your content based on various dimensions. It provides insights into how different factors contribute to the overall metrics.
#### How it works
Before using this endpoint, you can call the <a href="https://docs.fastpix.io/reference/list_dimensions">List Dimensions</a> endpoint to retrieve all available dimensions that can be used in your query.
Make a `GET` request to this endpoint with the required `metricId` and other query parameters.
Receive a response containing the breakdown values for the specified metric, grouped and filtered according to your parameters.
Upon successful retrieval, the response will include the breakdown values based on the specified parameters. Note that the time values ( `totalWatchTime` and `totalPlayingTime` ) are in milliseconds.
#### Example
A developer wants to analyze how watch time varies across different device types. By calling this endpoint for the `playing_time` metric and filtering by `device_type`, they can understand how engagement differs between mobile, desktop, and tablet users. This data will guide optimization efforts for different platforms.
Related guide: <a href="https://docs.fastpix.io/docs/metrics-overview">Understand data definitions</a>
func (*Metrics) ListComparisonValues ¶ added in v1.0.0
func (s *Metrics) ListComparisonValues(ctx context.Context, timespan operations.ListComparisonValuesTimespan, filterby *string, dimension *operations.ListComparisonValuesDimension, value *string, opts ...operations.Option) (*operations.ListComparisonValuesResponse, error)
ListComparisonValues - List comparison values This endpoint allows you to compare multiple metrics across specified dimensions. You can specify the metrics you want to compare in the query parameters, and the response will include the relevant metrics for the specified dimensions.
#### How it works
Before making a request to this endpoint, call the <a href="https://docs.fastpix.io/reference/list_dimensions">list dimensions</a> endpoint to obtain all available dimensions that can be used for comparison.
Make a `GET` request to this endpoint with the desired metrics specified in the query parameters.
Receive a response containing the comparison values for the specified metrics across the selected dimensions.
Related guide: <a href="https://docs.fastpix.io/docs/understand-dashboard-ui#compare-metrics">Compare metrics in dashboard</a>
func (*Metrics) ListOverallValues ¶ added in v1.0.0
func (s *Metrics) ListOverallValues(ctx context.Context, metricID operations.ListOverallValuesMetricID, timespan operations.ListOverallValuesTimespan, measurement *string, filterby *string, opts ...operations.Option) (*operations.ListOverallValuesResponse, error)
ListOverallValues - List overall values Retrieves overall values for a specified metric, providing summary statistics that help you understand the performance of your content. The response includes key metrics such as `totalWatchTime`, `uniqueViews`, `totalPlayTime` and `totalViews`.
#### How it works
Before using this endpoint, you can call the <a href="https://docs.fastpix.io/reference/list_dimensions">list dimensions</a> endpoint to retrieve all available dimensions that can be used in your query.
Make a `GET` request to this endpoint with the required `metricId` and other query parameters.
Receive a response containing the overall values for the specified metric, which may vary based on the applied filters.
#### Key fields in response
**value:** The specific metric value calculated based on the applied filters.
**totalWatchTime:** Total time watched across all views, represented in milliseconds.
**uniqueViews:** The count of unique viewers who interacted with the content.
**totalViews:** The total number of views recorded.
**totalPlayTime:** Total time spent playing the video, represented in milliseconds.
**globalValue:** A global metric value that reflects the overall performance of the specified metric across the entire dataset for the given timespan. This value is not affected by specific filters.
Related guide: <a href="https://docs.fastpix.io/docs/metrics-overview">Understand data definitions</a>
type Playback ¶
type Playback struct {
// contains filtered or unexported fields
}
func (*Playback) CreateMediaPlaybackID ¶
func (s *Playback) CreateMediaPlaybackID(ctx context.Context, mediaID string, requestBody *operations.CreateMediaPlaybackIDRequestBody, opts ...operations.Option) (*operations.CreateMediaPlaybackIDResponse, error)
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 <a href="https://docs.fastpix.io/reference/get-media">Get Media by ID</a> 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 this endpoint, replacing `<mediaId>` with the `uploadId` or `id` of the media asset.
2. Include the `accessPolicy` in the request body with `private` or `public` as the value.
3. Receive a response containing the newly created playback ID with the requested access level.
#### Example 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) 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 this endpoint, replacing `<mediaId>` with the unique ID of the media asset from which you want to delete the playback ID.
2. Specify the `playbackId` you wish to delete in the request body.
#### Example
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) GetPlaybackID ¶ added in v1.0.0
func (s *Playback) GetPlaybackID(ctx context.Context, mediaID string, playbackID string, opts ...operations.Option) (*operations.GetPlaybackIDResponse, error)
GetPlaybackID - Get a playback ID This endpoint retrieves details about a specific playback ID associated with a media asset. This endpoint is commonly used to check the access policy (e.g., public or private) with the specific playback ID.
**How it works:** 1. Make a GET request to the endpoint, replacing `{mediaId}` with the `id` of the media, and `{playbackId}` with the specific playback ID. 2. Useful for auditing or validation before granting playback access in your application.
**Example:** A media platform might use this endpoint to verify if a playback ID is public or private before embedding the video in a frontend player or allowing access to a restricted group.
type Playlist ¶ added in v1.0.0
type Playlist struct {
// contains filtered or unexported fields
}
func (*Playlist) AddMediaToPlaylist ¶ added in v1.0.0
func (s *Playlist) AddMediaToPlaylist(ctx context.Context, playlistID string, mediaIdsRequest components.MediaIdsRequest, opts ...operations.Option) (*operations.AddMediaToPlaylistResponse, error)
AddMediaToPlaylist - Add media to a playlist by ID This endpoint allows you to add one or more media items to an existing playlist. By passing the media ID(s) in the request, the specified media items are appended to the playlist in the order provided. #### How it works
- When a user sends a PATCH request to this endpoint with the `playlistId` as path parameter and a list of media ID(s) in the request body, FastPix adds the specified media items to the playlist and returns the updated playlist details.
#### Example An e-learning platform adds new video tutorials to the "Beginner Python Series" playlist by sending their media IDs in the request. The playlist is updated with the new content, ensuring learners have access to the latest tutorials in sequence.
func (*Playlist) ChangeMediaOrderInPlaylist ¶ added in v1.0.0
func (s *Playlist) ChangeMediaOrderInPlaylist(ctx context.Context, playlistID string, mediaIdsRequest components.MediaIdsRequest, opts ...operations.Option) (*operations.ChangeMediaOrderInPlaylistResponse, error)
ChangeMediaOrderInPlaylist - Change media order in a playlist by ID This endpoint allows you to change the order of media items within a playlist. By passing the complete list of media IDs in the desired sequence, the playlist's play order is updated accordingly. #### How it works
- When a user sends a PUT request to this endpoint with the `playlistId` as path parameter and the reordered list of all media IDs in the request body, FastPix updates the playlist to reflect the new media sequence and returns the updated playlist details.
#### Example An e-learning platform rearranges the "Beginner Python Series" playlist by submitting a reordered list of media IDs. The playlist now follows the new sequence, providing learners with a better structured learning path.
func (*Playlist) CreateAPlaylist ¶ added in v1.0.0
func (s *Playlist) CreateAPlaylist(ctx context.Context, request components.CreatePlaylistRequest, opts ...operations.Option) (*operations.CreateAPlaylistResponse, error)
CreateAPlaylist - Create a new playlist This endpoint creates a new playlist within a specified workspace. A playlist acts as a container for organizing media items either manually or based on filters and metadata. <br> <br> ### Playlists can be created in two modes - **Manual:** An empty playlist is created without any initial media items. It's intended for manual curation, where items can be added later in a user-defined sequence. - **Smart:** The playlist is auto-populated at creation time based on filters (video creation date range) criteria provided in the request.
#### How it works
- When a user sends a POST request to this endpoint, FastPix creates a playlist and returns a playlist ID, using which items can be added later in a user-defined sequence.
- For a smart playlist, the playlist will be auto-populated based on metadata in the request body.
#### Example An e-learning platform creates a new playlist titled "Beginner Python Series" via the API. The response includes a unique playlist ID. The platform then uses this ID to add a series of video tutorials to the playlist in a defined order. The playlist is presented to learners on the frontend as a structured learning path.
func (*Playlist) DeleteAPlaylist ¶ added in v1.0.0
func (s *Playlist) DeleteAPlaylist(ctx context.Context, playlistID string, opts ...operations.Option) (*operations.DeleteAPlaylistResponse, error)
DeleteAPlaylist - Delete a playlist by ID This endpoint allows you to delete an existing playlist from the workspace. Once deleted, the playlist and its metadata are permanently removed and cannot be recovered. #### How it works
- When a user sends a DELETE request to this endpoint with the `playlistId`, FastPix removes the specified playlist from the workspace and returns a confirmation of successful deletion.
#### Example An e-learning platform deletes an outdated playlist titled "Old Python Tutorials" by providing its unique playlist ID. The platform receives confirmation that the playlist has been removed, ensuring learners no longer see the obsolete content.
func (*Playlist) DeleteMediaFromPlaylist ¶ added in v1.0.0
func (s *Playlist) DeleteMediaFromPlaylist(ctx context.Context, playlistID string, mediaIdsRequest *components.MediaIdsRequest, opts ...operations.Option) (*operations.DeleteMediaFromPlaylistResponse, error)
DeleteMediaFromPlaylist - Delete media in a playlist by ID This endpoint allows you to delete one or more media items from an existing playlist. By passing the media ID(s) in the request, the specified media items are removed from the playlist. #### How it works
- When a user sends a DELETE request to this endpoint with the playlist ID as the path parameter and the media ID(s) to be removed in the request body, FastPix deletes the specified media items from the playlist and returns the updated playlist details.
#### Example An e-learning platform removes outdated video tutorials from the "Beginner Python Series" playlist by specifying their media IDs in the request. The playlist is updated to exclude these items, ensuring learners only access relevant content.
func (*Playlist) GetAllPlaylists ¶ added in v1.0.0
func (s *Playlist) GetAllPlaylists(ctx context.Context, limit *int64, offset *int64, opts ...operations.Option) (*operations.GetAllPlaylistsResponse, error)
GetAllPlaylists - Get all playlists This endpoint retrieves all playlists present within a specified workspace. It allows users to view the collection of playlists that have been created, whether manual or smart, along with their associated metadata. #### How it works
- When a user sends a GET request to this endpoint, FastPix returns a list of all playlists in the workspace, including details such as playlist IDs, titles, creation mode (manual or smart), and other relevant metadata.
#### Example
An e-learning platform requests all playlists within a workspace to display an overview of available learning paths. The response includes multiple playlists like "Beginner Python Series" and "Advanced Java Tutorials," enabling the platform to show users a catalog of curated content collections.
func (*Playlist) GetPlaylistByID ¶ added in v1.0.0
func (s *Playlist) GetPlaylistByID(ctx context.Context, playlistID string, opts ...operations.Option) (*operations.GetPlaylistByIDResponse, error)
GetPlaylistByID - Get a playlist by ID This endpoint retrieves detailed information about a specific playlist using its unique `playlistId`. It provides comprehensive metadata about the playlist, including its title, creation mode (manual or smart), media items along with the metadata of each media in the playlist.
#### Example An e-learning platform requests details for the playlist "Beginner Python Series" by providing its unique `playlistId`. The response includes the playlist's title, creation mode, and the ordered list of video tutorials contained within, enabling the platform to present the full learning path to users.
func (*Playlist) UpdateAPlaylist ¶ added in v1.0.0
func (s *Playlist) UpdateAPlaylist(ctx context.Context, playlistID string, updatePlaylistRequest components.UpdatePlaylistRequest, opts ...operations.Option) (*operations.UpdateAPlaylistResponse, error)
UpdateAPlaylist - Update a playlist by ID This endpoint allows you to update the name and description of an existing playlist. It enables modifications to the playlist's metadata without altering the media items or playlist structure. #### How it works
- When a user sends a PUT request to this endpoint with the `playlistId` and updated name and description in the request body, FastPix updates the playlist metadata accordingly and returns the updated playlist details.
#### Example An e-learning platform updates the playlist titled "Beginner Python Series" to rename it as "Python Basics" and add a more detailed description. The updated metadata is reflected when retrieving the playlist, helping users better understand the playlist content.
type SDKOption ¶
type SDKOption func(*Fastpixgo)
func WithClient ¶
func WithClient(client HTTPClient) SDKOption
WithClient allows the overriding of the default HTTP client used by the SDK
func WithRetryConfig ¶
func WithSecurity ¶
func WithSecurity(security components.Security) SDKOption
WithSecurity configures the SDK to use the provided security details
func WithSecuritySource ¶
WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication
func WithServerIndex ¶
WithServerIndex allows the overriding of the default server by index
func WithServerURL ¶
WithServerURL allows the overriding of the default server URL
func WithTemplatedServerURL ¶
WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters
func WithTimeout ¶
WithTimeout Optional request timeout applied to each operation
type SigningKeys ¶ added in v1.0.0
type SigningKeys struct {
// contains filtered or unexported fields
}
func (*SigningKeys) CreateSigningKey ¶ added in v1.0.0
func (s *SigningKeys) CreateSigningKey(ctx context.Context, opts ...operations.Option) (*operations.CreateSigningKeyResponse, error)
CreateSigningKey - Create a signing key This endpoint allows you to create a new signing key pair for FastPix. When you call this endpoint, the API generates a 2048-bit RSA key pair. The privateKey will be returned in the response, encoded in Base64 format, and you will receive a unique key id to reference the key in future operations. FastPix will securely store the public key to validate signed tokens.
<h4>Instructions</h4>
**Private key handling:** The privateKey you receive is encoded in Base64. To use it, you'll need to decode it using Base64 decoding. Make sure to store this private key securely, as it is required for signing tokens.
**Key-ID:** The id will be used to reference this specific key pair in future API requests or configurations.
Once the key pair is generated, the private key must be securely stored by the developer, as FastPix will not save it. The public key will be used by FastPix to verify any signed tokens, ensuring that the client interacting with the system is legitimate.
<h4>Use case scenario</h4>
**Use case:** A developer building a video subscription service wants to ensure that only authorized users can access premium content. By generating a signing key, the developer can issue signed JSON Web Tokens (JWTs) to authenticate and authorize users. These tokens can be validated by FastPix using the stored public key.
**Detailed example:** Imagine a scenario where you're building a video-on-demand platform that restricts access based on user subscriptions. To ensure only subscribed users can stream content, you generate a signing key using this API. Each time a user logs in, you create a JWT signed with the private key. When the user attempts to play a video, FastPix uses the public key to verify the token and confirms that the user is authorized.
func (*SigningKeys) DeleteSigningKey ¶ added in v1.0.0
func (s *SigningKeys) DeleteSigningKey(ctx context.Context, signingKeyID string, opts ...operations.Option) (*operations.DeleteSigningKeyResponse, error)
DeleteSigningKey - Delete a signing key This endpoint allows you to delete an existing signing key, and the action is permanent. Once a key is deleted, any signatures or tokens generated using that key will immediately become invalid. This means you can no longer use the key to sign JSON Web Tokens (JWTs) or authenticate API requests. <h4>Usage</h4> To delete a signing key, you will need to provide the unique key id that was obtained when creating the signing key. This key id serves as the identifier for the specific signing key you want to remove from your account.
<h4>How it works</h4>
By specifying the key id, the API removes the signing key from the system. After the key is deleted, any API requests or tokens that rely on it will fail. This action is useful when a key is compromised or when rotating keys as part of security policies.
<h4>Use case scenario</h4>
**Use case:** A key used by an outdated application version has been compromised, or a developer accidentally leaked it. To prevent unauthorized access, the developer deletes the signing key, revoking its ability to sign requests immediately.
**Detailed example:** Let’s say you have a signing key used for a specific version of your mobile app, and you discover that this key has been compromised due to a security breach. To mitigate the issue, you delete the key to invalidate any tokens generated using it. As soon as the key is deleted, users on the compromised version of the app can no longer make valid requests, thus preventing further exploitation.
func (*SigningKeys) GetSigningKeyByID ¶ added in v1.0.0
func (s *SigningKeys) GetSigningKeyByID(ctx context.Context, signingKeyID string, opts ...operations.Option) (*operations.GetSigningKeyByIDResponse, error)
GetSigningKeyByID - Get signing key by ID This endpoint allows you to retrieve detailed information about a specific signing key using its unique key id. While the private key is not returned for security reasons, you'll be able to see the key's creation date, status, and other associated metadata. This endpoint also returns the workspaceId and publicKey in the response.
<h4>Usage: Generating a JWT token</h4>
In the response, you will receive the workspaceId and publicKey associated with the signing key. With the publicKey and the privateKey obtained from the "Create a Signing Key" endpoint, you can generate a JSON Web Token (JWT) using the RS256 algorithm. This token can be utilized for accessing private media assets, GIFs, thumbnails, and spritesheets.
<h4>Payload:</h4>
``` {
"kid": "359302ee-2446-4afe-9348-8b4656b9ddb1", "aud": "media:6cee6f85-9334-4a51-9ce3-e0241d94ceef", "iss": "fastpix.io", "sub": "", "iat": 1706703204, "exp": 1735626783
} ```
* **kid:** The key ID of the signing key. * **aud:** The audience for which the token is intended. * **iss:** The issuer of the token (e.g., "fastpix.io"). * **sub:** The subject of the token, typically representing the user or entity the token is issued for. In this case, use the workspaceId fetched from the "Get Signing Key by ID" endpoint. * **groups:** An array of groups the subject belongs to (e.g., ["user"]). * **iat:** The issued-at timestamp, indicating when the token was created. * **exp:** The expiration timestamp, indicating when the token will no longer be valid.
<h4>Use case scenario</h4>
**Use case:** A developer is unsure about the status of a signing key they created months ago and wants to verify whether it's still in use or has expired.
**Detailed example:** You’re working on a streaming platform and realize you haven’t checked the status of a signing key that was used for playback access several months ago. By fetching the key details using its ID, you can confirm whether it’s still active, when it was created, and if it’s nearing expiration. This allows you to plan a rotation or deactivation if needed.
func (*SigningKeys) ListSigningKeys ¶ added in v1.0.0
func (s *SigningKeys) ListSigningKeys(ctx context.Context, limit *float64, offset *float64, opts ...operations.Option) (*operations.ListSigningKeysResponse, error)
ListSigningKeys - Get list of signing key This endpoint returns a list of all the signing keys associated with an organization in FastPix. Each key entry in the response includes metadata such as the key id, creation date, and workspace details. This helps you manage multiple keys, track their usage, and identify which keys are valid for signing API requests.
<h4>How it works</h4>
The API returns the list in a paginated format, allowing you to audit and track all keys used for your application. Regularly reviewing this list is essential for ensuring that old or compromised keys are promptly revoked and that new keys are properly integrated into workflows.
<h4>Use case scenario</h4>
**Use case:** A security-conscious development team wants to ensure they follow a key rotation policy, rotating signing keys every few months. By retrieving the list of signing keys, they can identify which keys are still in use and which ones need to be rotated.
**Detailed example:** You're managing a multi-region video platform where different teams in different regions have created their own signing keys. To ensure compliance with your organization's security policies, you regularly review the list of signing keys to verify which ones are still active. You find a few keys that haven’t been used in months, and based on the creation date, you decide to rotate them.
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. Simulcasting enables you to broadcast the live stream to multiple social 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 idle state (i.e., not currently live or disabled). Additionally, only one simulcast target can be created per API call. #### How it works
1. 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.
2. To notify your application about the status of simulcast related events check for the <a href="https://docs.fastpix.io/docs/webhooks-collection#simulcast-target-events">webhooks for simulcast</a> target events.
#### 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.
Related guide: <a href="https://docs.fastpix.io/docs/simulcast-to-3rd-party-platforms">Simulcast to 3rd party platforms</a>
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.
Webhook event: <a href="https://docs.fastpix.io/docs/live-events#videolive_streamsimulcast_targetdeleted">video.live_stream.simulcast_target.deleted</a>
#### Example A broadcaster needs to stop simulcasting to one platform due to technical difficulties while keeping the stream active on others. For instance, 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 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 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 simulcast 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.
Webhook event: <a href="https://docs.fastpix.io/docs/live-events#videolive_streamsimulcast_targetupdated">video.live_stream.simulcast_target.updated</a>
#### Example 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 ¶
func (s *StartLiveStream) CreateNewStream(ctx context.Context, request components.CreateLiveStreamRequest, opts ...operations.Option) (*operations.CreateNewStreamResponse, error)
CreateNewStream - Create a new stream Allows you to initiate a new <a href="https://docs.fastpix.io/docs/get-started-with-live-streaming">RTMPS</a> or <a href="https://docs.fastpix.io/docs/using-srt-to-live-stream">SRT</a> live stream on FastPix. Upon creating a stream, FastPix generates a unique `streamKey` and `srtSecret`, which can be used with any broadcasting software (like OBS) to connect to FastPix's RTMPS or SRT servers. 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>
1. Send a a `POST` request to this endpoint. You can configure the stream settings, including `metadata` (such as stream name and description), `reconnectWindow` (in case of disconnection), and privacy options (`public` or `private`).
2. FastPix returns the stream details for both RTMPS 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.
3. 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/live-events#videolive_streamcreated">video.live_stream.created</a>.
**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.
Related guide: <a href="https://docs.fastpix.io/docs/how-to-livestream">How to live stream</a>
type Views ¶ added in v1.0.0
type Views struct {
// contains filtered or unexported fields
}
func (*Views) GetDataViewlistCurrentViewsFilter ¶ added in v1.0.0
func (s *Views) GetDataViewlistCurrentViewsFilter(ctx context.Context, dimension *operations.GetDataViewlistCurrentViewsFilterDimension, limit *int64, opts ...operations.Option) (*operations.GetDataViewlistCurrentViewsFilterResponse, error)
GetDataViewlistCurrentViewsFilter - Get concurrent viewers breakdown by dimension Retrieves a real-time breakdown of present concurrent viewers, grouped by a chosen dimension. This endpoint allows you to see how your audience is distributed across different categories like geography, content, or technology, based on activity in the last 30 minutes.
For example, you can see how many viewers are currently watching from the US vs. India, or which video titles are most popular right now.
#### How it works
1. Make a `GET` request to this endpoint.
2. Specify the `dimension` you want to group by in the query parameters (e.g., `dimension=country` or `dimension=video_title`). This is the most important parameter as it defines how the data is categorized.
3. Optionally, use the `limit` parameter to control the number of results returned (e.g., `limit=5` to get the top 5 countries).
4. The API analyzes viewer data from the last 30 minutes and aggregates the viewer counts for each unique value within the chosen dimension.
5. Receive a response containing a `data` array, where each object represents a specific group (e.g., a country or a video title) and its corresponding number of `concurrent_viewers`.
#### Example
Imagine you are running a global streaming platform and have just launched a new original series. You want to see, in real-time, which regions are engaging most with the new content versus your older library content.
By calling this endpoint with `dimension=video_title`, you can immediately see a list of your most-watched videos right now and their respective viewer counts. Then, by calling it again with `dimension=country`, you can get a live breakdown of your audience's geographic distribution. This helps you confirm if your marketing efforts in specific countries are paying off instantly and allows you to make data-driven decisions during live events.
func (*Views) GetDataViewlistCurrentViewsGetTimeseriesViews ¶ added in v1.0.0
func (s *Views) GetDataViewlistCurrentViewsGetTimeseriesViews(ctx context.Context, opts ...operations.Option) (*operations.GetDataViewlistCurrentViewsGetTimeseriesViewsResponse, error)
GetDataViewlistCurrentViewsGetTimeseriesViews - Get concurrent viewers timeseries Retrieves a time series of the number of concurrent viewers, providing a real-time snapshot of audience activity over the last 30 minutes. This endpoint is essential for monitoring live events, gauging audience reaction to new content releases, or understanding immediate engagement trends.
#### How it works
Make a simple `GET` request to this endpoint. No query parameters are needed.
The API automatically gathers data for the **last 30 minutes**, calculating the number of concurrent viewers at regular intervals within that window.
Receive a response containing a `data` array, where each object represents a specific point in time.
Each object in the array includes the `intervalTime` (the timestamp of the measurement) and `numberOfViews` (the count of concurrent viewers at that instant), allowing you to easily plot viewer activity over time.
#### Example
Imagine you are streaming a major live event, such as a product launch, a sports game, or a webinar. You need to monitor audience engagement in real-time to see if viewership is increasing, decreasing, or holding steady.
By calling this endpoint periodically (e.g., every minute), you can plot a live graph of your viewership. This allows you to identify peak moments of interest, see the immediate impact of social media promotions, or detect potential technical issues if there's a sudden, unexpected drop in viewers
func (*Views) GetVideoViewDetails ¶ added in v1.0.0
func (s *Views) GetVideoViewDetails(ctx context.Context, viewID string, opts ...operations.Option) (*operations.GetVideoViewDetailsResponse, error)
GetVideoViewDetails - Get details of video view Allows you to retrieve detailed information about a specific video view using its unique `viewId`. This is useful for getting insights into individual viewer interactions with your video content. This detailed information is valuable for enhancing user experience and improving engagement with your video assets.
Make a `GET` request to this endpoint and you will receive a response containing detailed information about the specified video view, including metrics and attributes related to that view.
#### Example
Suppose a developer receives a report of a poor viewing experience for a specific user. By using this endpoint with the user's `viewId`, the developer can retrieve metrics like buffering duration, playback errors, and session length. This data allows the developer to pinpoint issues (such as poor connectivity or a browser-specific problem) and take steps to improve the user experience.
Related guide: <a href="https://docs.fastpix.io/page/what-video-data-do-we-capture#/">What Video Data do we capture?</a>
func (*Views) ListByTopContent ¶ added in v1.0.0
func (s *Views) ListByTopContent(ctx context.Context, timespan operations.ListByTopContentTimespan, filterby *string, limit *int64, opts ...operations.Option) (*operations.ListByTopContentResponse, error)
ListByTopContent - List by top content Retrieves a list of the top video views that fall within the specified filters and have been completed within a defined timespan. It allows you to identify the most popular content based on viewer interactions.
#### How it works
Make a `GET` request to this endpoint with the desired query parameters.
Specify the timespan for which you want to retrieve the top content using the `timespan[]` parameter.
Filter the views based on dimensions such as browser, device, video title, etc., using the `filterby[]` parameter.
`Limit` the results to control the number of top views returned.
Receive a response containing the list of top video views matching the specified criteria.
Related guide: <a href="https://docs.fastpix.io/page/how-to-get-top-performing-content">Get top-performing content</a>
func (*Views) ListVideoViews ¶ added in v1.0.0
func (s *Views) ListVideoViews(ctx context.Context, request operations.ListVideoViewsRequest, opts ...operations.Option) (*operations.ListVideoViewsResponse, error)
ListVideoViews - List video views Retrieves a list of video views that fall within the specified filters and have been completed within a defined timespan. It allows you to analyse viewer interactions with your video content effectively.
#### How it works
Make a `GET` request to this endpoint with the desired query parameters.
Specify the timespan for which you want to retrieve the video views using the `timespan[]` parameter.
Filter the views based on dimensions such as browser, device, video title, viewer ID, etc., using the `filterby[]` parameter. Get the dimensions by calling <a href="https://docs.fastpix.io/reference/list_dimensions">list the dimensions</a> endpoint.
Paginate the results using the `limit` and `offset` parameters.
Optionally, filter by `viewerId`, `errorCode`, `orderBy` a specific field, and sort in ascending or descending order.
Receive a response containing the list of video views matching the specified criteria.
Each view in the response will include a unique `viewId`. You can use this `viewId` to call the <a href="https://docs.fastpix.io/reference/get_video_view_details">get details of video view</a> endpoint to retrieve more detailed information about that specific view.
#### Example
Suppose you're managing a video streaming service and need to analyze how the content performs across different devices and browsers. By calling the List Video Views endpoint with filters like `browser_name` and `device_type`, you can get insights into which platforms are most popular with the audience. This data will help you optimize content for the most-used platforms and troubleshoot any playback issues on less common devices.
Related guide: <a href="https://docs.fastpix.io/docs/audience-metrics">Audience metrics</a>, <a href="https://docs.fastpix.io/docs/understand-dashboard-ui#1-views-dashboard">Views dashboard</a>