-
Notifications
You must be signed in to change notification settings - Fork 0
Message Replay with VoD
With Straas, after a live is ended, the live will be transcoded to a VoD(video on demand) right after the live is ended (3 minutes at most). These VoDs could bring significant value for content owners. For live content, interactions are crucial part of content. To provide the VoD audiences similar experiences as the live audiences, how to let the message replay just like the content is in live is one of Straas's key goal.
To achieve this feature, Straas provides 2 steps practice:
- Archive the messages: Through server to server API after the live show is ended
- Fetch archived messages: Through SDK (Web, Android, iOS), Straas provide convenient interface to help our customers to implement this feature.
We introduce the detail of each step in following sections
Originally, you need to fetch the old messages through the getMessages(web, android, ios) function, which is designed for fetching quickly changing messages for live scenario, so the interface and longer response time are sacrificed to fit this scenario. In messages replay, the requirements are quite different from live.
In messages replay, how to fetch large and fixed data and provide a short response time are the key factors. To achieve this goal, we provide an API for Archive Messages
to archive a block of messages to facilitate the following step.
When using Archive Messages API
, you need to decide
-
archiveId
: This id could be decided by yourself, and would be used to fetch the correct archived messages in next step. For best practice, if each chat is mapping to a single live event, we recommended to usechatroomName
as thearchiveId
, . Otherwise, you could uselive event id
as thearchiveId
-
oldestDate
,latestDate
: Besides the archiveId, you also need to decide the time period. This period could be get in the next step. -
msgType
: For different use cases, you might want to archive different kinds of messages(The difference ofraw
andtext
is explain in here).
After the message is properly archived, the sdk could fetch the correct bundle of archived messages by using archiveId
.
Please refer to following link for api document:
- web sdk: getArchivedMessages, getArchivedMessagesMeta
- android sdk (5/24 online)
- ios sdk (5/24 online)
Besides archived messages, if you also are Straas streaming cloud's customer, you can fetch video detail and the you could implement the messages replay by using the live_started_at
, live_ended_at
combine with the player playtime to fetch a short period of archive messages to achieve self-designed UI/UX.
The samples are still under construction