Live Stream
Host your events virtually and see community interaction as it happens.

There is a limitation to the maximum number of concurrent live events. Reach out to us at community.social.plus.co with your use-case and we will determine if the current limit can be raised.
Create a stream
To create a stream, follow the code below. This will return an instance of the created Stream
.
isSecure: By setting isSecure
as true
the created stream will be available as https
url.
Create child streams
The SDK supports creating a post with multiple streams, and the AmityStream object maintains the parent–child relationship. In the case of a stream post, only the parent stream will be linked to the post.
To create a child stream that is related to a parent stream, the parentStreamId must be passed as a parameter, and the parent stream must be created first.
The following fields are added to the AmityStream object to specify the relationship:
isParent:
true
if the stream is a parent,false
if the stream is a childparentStreamId: the ID of the parent stream
childStreamIds: contains all child streams of the parent stream
To retrieve the child stream objects, we provide the getChildStreams property inside the parent stream object.
Enable live chat channel and reaction in a stream
The livestream chat and reaction features are enabled by setting the channelEnabled
field when creating a stream object.
These features are supported only for livestream posts created within a community.
After creating a stream post, the stream object will include the following properties to indicate related information:
{
...
referenceId: 'postId',
referenceType: 'post',
targetId: 'communityId',
targetType: 'community',
postId: 'postId',
channelId: 'channelId',
channelEnabled: true,
...
}
Note: When getLiveChat()
is called on the streamer side, the SDK creates a new live chat channel linked to the stream if one does not already exist. On the viewer side, calling getLiveChat()
returns the live chat channel object only if it has already been created.
Delete a stream
To delete a stream, you will need the ID of the stream that you want to delete. The function will return true if successfully deleted, otherwise, it will throw an error.
Dispose a stream
Disposing a stream means updating the streaming status to ended and invalidating the streaming URL.
To dispose a stream, you need the ID of the stream that you want to dispose. The function will return true if successfully deleted, otherwise, it will throw an error.
Last updated
Was this helpful?