Skip to content

Message Replay with VoD

Hsueh-Jen edited this page Apr 29, 2020 · 6 revisions

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:

  1. Archive the messages: Through server to server API after the live show is ended
  2. 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

Step 1: Archive the Messages

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

  1. 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 use chatroomName as the archiveId, . Otherwise, you could use live event id as the archiveId

  2. oldestDate, latestDate: Besides the archiveId, you also need to decide the time period. This period could be get in the next step.

  3. msgType: For different use cases, you might want to archive different kinds of messages(The difference of raw and text is explain in here).

Step 2: Fetch archived messages through SDK

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:

  1. web sdk: getArchivedMessages, getArchivedMessagesMeta
  2. android sdk (5/24 online)
  3. 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.

Samples

The samples are still under construction

Clone this wiki locally