AnnouncementsMatrixEventsFunnyVideosMusicAncapsTechnologyEconomicsPrivacyGIFSCringeAnarchyFilmPicsThemesIdeas4MatrixAskMatrixHelpTop Subs
6

Last night's movie night went great. I had finished up the code for that just an hour before we started. I'm glad things didn't break.

So now I'm just putting in a tiny bit more effort into general chat before I focus more on the movie aspect. Today's work started with a simple goal. I wanted the disconnect indicator (red dot) to show up in full chat. When I tested it the obvious thing to do was to disconnect my wifi to break the connection. Hmmm, it didn't show.

The issue is I've been relying on the onclose and onerror events to detect when to reopen a web socket. And as the intentional wifi disconnect proved this can delay firing for a very long time after there isn't a connection.

What was weird is if I reconnected the wifi and sent a message the server would get it, but the client wouldn't receive it back.

So two new things have been added. Health checks and a message buffer. A pong is sent very often. If the last pong we've seen is greater than a certain amount we close the websocket, thus actually triggering onclose, causing a new one to open. But an even stricter policy is that if we haven't seen a pong in a much shorter amount of time we consider the connection to be suspect. We push the message onto a buffer and reset the connection anyway. Heck if I wanted I could even set that policy lower than my pong rate. A chance a new websocket will open when a user sends a message doesn't really cost anything and is guaranteed to send the message on a fresh connection. The websocket is really more needed to get messages from others. Only reason to not do that is a 1/2 second delay that feels less responsive.

So right now the pong rate is 10 seconds.
The manual close is 40 seconds without seeing a pong.
We need to have seen a pong within the last 10 seconds for a connection to be good enough to send out.

That pong rate is pretty high but I don't want chat to eat a message ever. Maybe I'll raise it.

Of course any modification of code can have the opposite impact so do play with chat and tell me if there are issues.

Edit: Now the question is how much UI I want to add to the movie stuff. Using the command '/add url' can add content. Will enough of the right people remember that or do I need to add another input bar?

Comment preview
[-]JasonCarswell1(+1|0)

I wanted the disconnect indicator (red dot) to show up in full chat.

Can you make it three colours please?
Red = offline, Yellow = unsure, Green = verified connection.
I'm guessing it isn't always going eating up bandwidth, but pings, unless you're active with a submission. If so, the pings would be green for a second, then yellow between pings, and red if missing a ping or few. Maybe I'm wrong about it.

Is a pong similar to a ping - or the same thing?

IMO, the movie (with controls and playlist(s)/feed(s)) should be in a separate URL. The chat could have a side frame play it and/or allow folks to pop it out. Ideally the frame could be resized (it couldn't before) and be located on the left, right, top or bottom of chat.

[-]x0x71(+1|0)

Also it now uses yt-dlp media metadata scraping a redirection. Ironically that means a lot of media websites are supported besides youtube. I know gvid, X.

[-]JasonCarswell1(+1|0)

Also it now uses yt-dlp media metadata scraping a redirection. Ironically that means a lot of media websites are supported besides youtube. I know gvid, X.

Can you please explain what any of this means in further detail? I don't comprehend. What about Gvid and X?

[-]x0x71(+1|0)

And I just added a lot of chat commands that people can use to control the play list. Most important is /add

But we also have:
/skip
/back
/seek
/remove
/help

Some of these require a badge to use.

[-]JasonCarswell1(+1|0)

Shorter?:

/> (play)
/> title (play title)
/>> (skip/forward)
/<< (back/reverse)
/? (help)
/del (remove)
/dir (list videos)