Project

General

Profile

Actions

Feature #3130

open

Chat receipts extension

Added by Gregory Magarshak 11 months ago.

Status:
New
Priority:
High
Category:
-
Start date:
07/24/2024
Due date:
08/05/2024 (about 10 months late)
% Done:

0%

Estimated time:
20.00 h

Description

When users load messages in a stream and update their local "last seen" ordinal, we should send a message via socket, to post "Streams/seen" ephemeral message with the latest ordinal they've seen, and also update the "extra" of their participant, named "Streams/seen" to the last ordinal they've seen. That way others who have testReadLevel("receipts") can see that others have seen a message.

But also we should do this for audio and video clips. These are separate streams, and we should be recording metrics of what they listened to. Andrey Tepaykin already implemented that with streams_metrics.

Please also post ephemeral messages of type "Streams/receipt" to the relevant stream (chat, audio, video) whenever someone's browser loads a chat message.

Note that "seeing" a related audio/video is not the same as "playing" it. And similarly, if there is a long chat message, then clicking on it opens a dialog, this is like "playing" it. Anyway, you should be updating the metrics on any audio/video as people listen to it, so there are statistics on who listened to what (anyone who has readLevel "receipts" would be able to see this information).

Seen Interface

Please implement Users/strip tool, which will show a list of small avatars, and if the number is greater than N, it will just show the number on the right. Like this: [ O O O / 18 ] where O are the avatars. Clicking it will call onInvoke, which by default should open a Q.Dialogs.push() with a Users/list of all the avatars.

Please implement a Streams/seen/chat.js extension to the Streams/chat tool. Below each message, you should show the avatars of the people who have seen it. You would get this from the participants extra, that you read. Only load this information if user has testReadLevel("receipts"). When chat is refreshed, you use this participants extra. And after that listen to ephemeral messages to update the avatars (i.e. move them below lower messages.)

If a message has at least one user with "last seen ordinal" = that ordinal, then show the strip below. But if the user's "last seen ordinal" increases, then remove him from that strip and put him into a lower strip. You can hide/remove Users/strip tools when there are no more users there. (The id suffix of the strip tool should be the message ordinal).

Played Interface

Note that "playing" an audio/video is different than "seeing" it. It's a separate, related stream. So Users/strip would be shown below every message, with users who have "seen" the message, but not necessarily "played" the audio/video.

When a user plays an audio/video, add him as a participant to that stream, and store in his "Streams/receipt" participant extra, what he has seen. This is in addition to the metrics you are storing.

When a user plays an audio/video, you already send a request to update streams_metrics every minute, or whenever they pause. Now we need to be able to show that metrics tool in a dialog. Now we need a way to visualize it.

Ideally, the way to visualize is a 2-dimensional graph. The height of the graph is the number of people that watched a particular minute, and the width of the graph is the duration of the audio/video. Basically, it's a curve that can be overlaid over the audio/video.

Ideally, we should be able to show it with bars, using color instead of height. So for example you have audio represented by a waveform of bars, and the color of the some bars is more deep blue as more people watch it. If 1/10 people listened/watched the first minute, then it would be 1/10 blue. If nearly all participants watched, then it would be 10/10 blue. You'd need to make Streams/metrics/graph tool or something.

Most other chat programs show the waveform of the audio based on the volume. I'm not so concerned about that. I'm more concerned about who watched what, and showing a duration.

The audio/video preview player should show the duration, and then when you play it, it should pop out in a dialog and play, showing the Streams/metrics/graph and Users/list of other users who have played it (if you have enough readLevel).

No data to display

Actions

Also available in: Atom PDF