Manage streams
When working with live streams, you would want to manage your streams, retrieve details about them, update or even delete your streams, and also enable or disable the access to stream live.
Single stream
Setting up a single live stream is ideal when you'll only have one active stream at a time or for temporary, one-time broadcasts. For instance, if you're organizing a conference with a series of consecutive speakers, using a single live stream is ideal for this purpose.
Multiple streams
Setting up multiple live stream configurations is necessary when you anticipate having multiple live streams. This setup is useful for various scenarios with concurrent streams that start at the same time or overlap.
Best practice for multiple concurrent streams
Sure, when you're dealing with several live streams happening at the same time, it's smart to set up different configurations for each one. Each configuration is like a setup tailored specifically for a particular live event. For instance, if you're running multiple events concurrently, you should create a unique configuration for each event.
Show live stream (retrieve stream details for watching)
You can get all the details about any live stream by sending a request with the live stream ID. The response will display the current status of the live stream and fetch all necessary details if you intend to broadcast that specific live stream.
API reference for Get all live streamsAPI
curl -X GET 'https://v1.fastpix.io/live/streams'
--user {Access Token ID}:{Secret Key} \
Update a live stream
To update details for a particular live stream, you would need the streamId for your live stream. In your request you can update the following parameters:
- maxResolution: You have the option to select the maximum resolution across 480p, 720p, 1080p for your live broadcast.
- reconnectWindow: When broadcasting software for live streaming purposefully or because of network problems disconnects from FastPix, the Reconnect Window specifies how long FastPix will wait (in seconds) before concluding the recorded asset and declaring the stream to be over. If no Reconnect Window is supplied, the API falls back to a 60-second window.
- maxDuration: The duration in seconds that a live stream can have before disconnecting.
Here’s is a request example:
curl -X PATCH 'https://v1.fastpix.io/live/streams/{streamId}'
--user {Access Token ID}:{Secret Key} \
-H 'Content-Type: application/json' \
-d '{
"metadata": {
"livestream_name": "Gaming_stream"
},
"reconnectWindow": 100
}'
Delete a live stream
Here’s is a request example:
curl -X DELETE 'https://v1.fastpix.io/live/streams/{streamId}'
--user {Access Token ID}:{Secret Key} \
Reset stream key
If you've lost or suspect your stream key for a live stream configuration has been compromised, you can use the reset stream key API to generate a new one.
Enable or disable live stream
You can use the enable live stream API endpoint to let a particular live stream event receive an RTMP session. It simply enables the stream. When provided true it makes the stream allow broadcaster/user to use the Stream key to stream their event. In case a live stream event/configuration has to be disabled, you can use the disable live stream API to disable it. This doesn’t let the live stream configuration accept any further RTMP session until and unless the live stream is again enabled.
Updated 21 days ago