Code Monkey home page Code Monkey logo

zorchenhimer / movienight Goto Github PK

View Code? Open in Web Editor NEW
663.0 663.0 84.0 4.84 MB

Single instance video streaming server with integrated chat.

Home Page: https://discord.gg/F2VSgjJ

License: MIT License

Makefile 0.95% Go 71.75% HTML 4.31% JavaScript 16.78% CSS 5.86% Dockerfile 0.27% Batchfile 0.09%
chat-room golang-web-application livestreaming movienight movienight-stream-server rtmp-port stream streaming video video-streaming webassembly websocket-chat

movienight's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

movienight's Issues

Move name checking into MovieNight/common

Move name checking logic into MovieNight/common so the front end can also validate name via the wasm module. This will allow the same checking on both sides and save the UI a trip via websockets and showing possible errors. Keep the validation in the server since messages can still be send directly from the js websocket.

Add autocomplete for names

When typing "@" w/o a partial name after it, get the list of users and suggest an autocomplete for the name.

Add padding for chat box

During the first run of this server, I had trouble reading the text because the words were so close together. Adding a padding or margin around the words would work. We could do it like twitch does

.chat-line__message, .chat-line__moderation, .chat-line__status {
    padding: .5rem 2rem;
    word-wrap: break-word;
}

Add a help viewer for the help commands

When a user types the /help command, have one of the following occur:

  • open a new tab with the help page
  • show a popup
  • show help in text

Another posibility is having autocomplete for commands. If #7 and #9 work out well, then autocomplete for commands could work also. There would have to be hidden commands like /auth which do not show up in help or autocomplete.

Currently /auth shows up in the help page.

Save color information

Save the color information with the ip/name. This way when someone refreshes or joins next time, the color doesn't have to be changed.

Add injection of images into chat

This could be done by checking for specific sites when links are pasted, such as imgur or giphy, and then replacing them like emotes are done.

User badges

Add badges for admins an moderators. Admins should have a different badge from moderators and it should show up to the left of the user's name in chat.

Write the /help command

Auto-generate the /help command's output from the CommandControl object. Maybe display results in a new popup window instead of in chat?

Bans broken when behind reverse proxy (eg, Nginx)

If the server is sitting behind an Nginx reverse proxy, all IP addresses are 127.0.0.1. Nginx (and probably the others) can add an X_Forwarded_For header with the client's real IP. This should be passed along to the server to check for bans.

Add highlighting of names when mentioned.

When a user's name is mentioned, add highlighting to it, either the entire line, the name, or changing the color of the name.

Images below are from in browser editing. Color still to be determined.

Line:
image

Name Background:
image

Name Color:
image

Edit:
Add a way to turn off highlighting and highlight on multiple names

Replace favicon

Putting this here as a bug so I don't forget. I don't want the favicon in this repository to be my avatar. Change it to something movie themed maybe?

Change infoBox layout

The current way the infoBox layout is, makes the spacing for the UI very finicky. Perhaps having an div that is hidden at the top and shows when hovering would work better.

Add some logging levels

Add some log levels. Specifically, only print errors by default and not all the things that are being done (eg, [static] serving "js/both.js" from folder ./static/).

This should be configurable and have more than one level available:

  • Debug/verbose (print everything)
  • Just chat and start/stop stream
  • Only errors

Optionally, the log should write to a file and should be configurable from the settings. I don't think this is something that needs a command, but I'm not opposed to adding one to change logging levels.

Safe Websocket Connections

I have ran into an issue where the websocket connection will panic because of conncurrent reads and writes. I think the best way to fix this would be to create a SafeConn, that uses mutexes on every read and send. That way the client mutex doesn't have to be used. This also solved the problem of the connections being called as a tempConn and as a Client.

Find some way to determine stream lag

Figure out a way to tell how much the client is lagging behind the stream. Ideally, if the lag is high enough, display the amount of lag below the player next to the reload player button.

Add a /purge command

This command would clear chat for everybody and display a message along the lines of "Chat was cleared by a moderator".

Client disconnects if idle and server is behind Nginx

The chat client will disconnect if it is behind an Nginx reverse-proxy if no messages are sent within about a minute.

The client should send a PING to the server to keep the connection alive. The server needs to read the PING from the client, but I don't think it needs to respond with a PONG to keep the connection open.

Add autocomplete for emotes

When typing a emote, an autocomplete should show up. Show autocomplete when a user types a colon and a letter. The letter has to be A-Za-z. When a user tabs for autocomplete, :smiaSip should be replaced with smiaSip

Below are the only forms an emote image should be replaced for in chat.

:smiaSip:
smiaSip
[smiaSip]

Add global message counts

Add a chatroom count for total messages sent and total messages received. This would help with debugging stress tests, and other possible problems when the number of messages sent is large. This would be configurable via settings. Perhaps "DebugCountMessages": true

Room access restrictions

There should be three levels of access to room access:

  • Public
  • Pin/Password
  • Request and grant

Rabbit had the first and third, but the pin/password option would be a useful middle ground between the two. Default access level should be configurable in the settings file and modifiable by an admin via a command in chat (possibly mods too?). Changing the access level in an active room should not kick any users currently connected. Full definitions for each access type are as follows:

Public

Allow access to anybody with the main URL. Video is loaded on page load, and is allowed to chat when a username is entered.

Pin/Password

Landing page is a simple pin or password entry form (with a username to avoid another input step for chat). Video and chat are loaded after a correct pin or password is entered. The pin or password will be global for the room and configurable by both the settings file and a command.

Maybe add the possibility of appending the pin to the URL as a GET variable (eg, ?pin=12345). Following the link will bring up the same landing page but with the pin pre-filled, leaving only a name to be entered.

Request/grant

Landing page is a simple name entry form and a button to request access to the room. Once submitted, mods and admins in the room will be notified and given the option to allow or deny access to the user requesting access, either by a pop-up of some sort or a command (command route might be a bit unwieldy for the mod/admin however).


I would personally like to use the pin/password method, but I do know some other streamers that I believe would prefer the Request/grant method instead.

Generate single-use mod passwords

Add an admin command to generate a one-time mod password. During the first movie night I had to confirm which username Mia had a few times before granting mod privileges. It would have been easier if I could have just DM'd her a password to enter.

Ideally, this would work by an admin typing /modpass and displaying a single-use password. Putting this password in chat would probably be difficult to copy and paste, so I'm ok with popping up a window with the password.

To use the password, the user would use the /auth command with the password. Once it is used, it should be invalidated on the server.

Remove old chat messages

Currently, messages are appended and never removed. This will become a problem for long sessions, as the chat will just keep growing.

Old chat messages should be removed. The cutoff should be configurable with the default probably around 100-200 messages.

Convert websocket communication from just text to json based objects

Right now communication between server and client is just via text being sent. The first message is the username, and commands start with /. It would be better to have a standard way of sending messages via objects. With the webassembly change, this will make customizable communication easier. It might be better to get this done before #17 since sending the username is the first message for now.

Add a pm command

Add a pm command.

/pm [name] [message]

Example usage: /pm zorchenhimer This is a pm

Load chat before entering a username

Load and display chat before the user enters a username. Instead of showing the message box at the bottom, show the "Enter Username" input.

Wait until after #4 is finished to implement this.

Add wasm side command input validation

The validation for commands would have to be moved into the common package. An example would be a user typing in /color redb. The wasm side detection would see that the command is wrong and will warn the user. Keep the server side checks because a user can still do

ws.Send('{"Type":0, Message: "/color redb"');

in the console.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.