This is for #32.
This adds a starting framework for loading, caching, and executing
templates on the server and the client. Currently only the server uses
this functionality.
This reverts commit 13d74faf01, reversing
changes made to ec0c6752bc.
These changes completely broke the RTMP stream. Reverting until I
figure out why.
Functions added:
- LogErrorf()
- LogErrorln()
- LogChatf()
- LogChatln()
- LogInfof()
- LogInfoln()
- LogDebugf()
- LogDebugln()
- LogDevf()
- LogDevln()
New settings configure the logging: LogLevel and LogFile. LogLevel can
be set to one of: error, chat, info, or debug and will default to
error. LogFile is an optional file to write to. Providing a file will
not prevent output in the console.
LogDevf() and LogDevln() only compile when the "dev" flag passed to
build. This will cause Travis-CI to fail the build if it finds any
calls to either function.
So far only PIN and Open modes are implemented. It uses a session
cookie to store the validity of the pin/password.
The "Enter pin" page has some unreadable messages on it right now, but
it kinda works.
Stream statistics will now print when enabled in settings.json. There is messages in, messages out,
and total time running. The main function was changed so the server setups for the main and rtmp
are in separate functions, and both are started with their own goroutine. OS Interrupt catching was added,
and if stream stats is true, the stats will be printed.
Added the "Cache-Control" header to responses for the main.wasm file.
This should help with debugging and updates by telling the browser not
to cache the web assembly binary.
Move the help html to a template and populate the lists dynamically.
This also splits out the base HTML stuff (eg, the <html> and <body>
tags) to a base template file.
When typing @ a div will show up with all the chat names that match.
When up or down arrow keys are pressed, the highlight changes.
Tab handling is currently incomplete but the event is prevented.
issue #7
handlePublish, handlePlay, and handleDefault have been added in
handlers.go and removed as anonymous functions in main.go. This also
required moving some struct and variable definitions around a bit.
Instead of using a GET value in the URL, split on the path separators
and use the second element of the path as the key. This enables
putting the stream key in the appropriate settings in OBS, instead of
appending it to the stream URL manually.
This still needs a bunch of work, but this should be OK until the UI is
rewritten.
The command injects a <script> tag to open up a new window. Mod and
admin commands are only shown to mods and admins (no authentication
happens for this).
Resolves#8 for now.