View & Play Live Stream
Host your events virtually and see community interaction as it happens.
In order to play a live stream or recorded live stream using the Typescript SDK, we have implemented an internal player. This player allows developers to easily incorporate video playback functionality into their applications. To utilize this feature, developers can refer to the example code provided below, which demonstrates how to play the desired video with simplicity and efficiency.
In the example code mentioned above, developers are required to provide a streamId
parameter to utilize the stream player functionality. This stream player is capable of playing both live streams and recorded live streams.
Recorded stream video refers to a previously streamed content that has concluded and has been recorded within the system.
Retrieve a stream object
Live streams and playback video information are stored in Amity.Stream
. To start working with the stream, first, the app needs to initialize the repository. To create a new SDK instance with your API key, refer to the Initialization section.
Each stream object has a unique identifier. To retrieve a single stream object. The stream object contains essential data such as title, description, streamerUrl, watcherUrl, etc
Stream Status
The stream consists of many states. It can change from one state to another, depending on events and actions.
Amity.StreamStatus.<STATUS>
represents a stream status. The following enum cases describe all the possible statuses of a stream.
IDLE
indicates "a stream that has generated but no actions have been taken."LIVE
indicates "a stream is currently being broadcasted."ENDED
indicates "a stream has ended broadcasting and is in the process of transforming to a recorded stream."RECORDED
indicates "a stream has ended broadcasting and has been transformed to a recorded stream."
Stream Moderation
The system offers real-time automated moderation for live streams, where streams can be flagged or terminated based on customizable thresholds set via the console. The SDK provides access to information about which categories the live stream has been flagged or terminated by.
Retrieve a stream collection
You can query a list of streams by calling queryStream
.
Last updated
Was this helpful?