disable videojs by default

このコミットが含まれているのは:
n9k 2021-05-15 04:35:48 +00:00
コミット adc76f0bb9
3個のファイルの変更7行の追加5行の削除

ファイルの表示

@ -30,14 +30,14 @@ This works on Linux, and should work on macOS and Windows with some tweaking. Lo
* Flood detection / liberal captcha
* Shows stream uptime
* List of users watching / not watching
* Optionally uses videojs (append `?videojs=0` to the URL to disable it)
* With videojs disabled, you can scrub backwards and forwards on the video timeline. If you scrub to the end (the most recent segment), you can achieve really quite low latency, as low as 12 seconds.
* Optionally uses videojs (append `?videojs=1` to the URL to enable it)
* With videojs disabled, you can scrub backwards and forwards on the video timeline. If you scrub to the end (the most recent segment), you can achieve really quite low latency, as low as 10 seconds.
* Works without JavaScript
## Issues
* CSS is spaghetti (e.g. the PureCSS framework is used sometimes when it might not need be)
* AFAIK the FFmpeg command in `stream.sh` only works on Linux, change it for other OSs
* Slow: stream delay of at least 30 seconds (lower with videojs disabled). Hopefully this will decrease when congestion control gets into Tor: https://youtu.be/watch?v=zQDbfHSjbnI
* Slow: stream delay of at least 10 seconds (>30 seconds with videojs enabled). Hopefully this will decrease when congestion control gets into Tor: https://youtu.be/watch?v=zQDbfHSjbnI
* Doesn't use low-latency HLS
## How it works

ファイルの表示

@ -18,6 +18,8 @@ CONFIG = json.load(open(CONFIG_FILE))
BROADCASTER_TOKEN = secrets.token_hex(8)
VIDEOJS_ENABLED_BY_DEFAULT = False
HLS_TIME = 8 # seconds per segment
VIEW_COUNTING_PERIOD = 30 # count views from the last x seconds
CHAT_TIMEOUT = 5 # seconds between chat messages

ファイルの表示

@ -9,7 +9,7 @@ import datetime
import website.chat as chat
import website.viewership as viewership
import website.utils.stream as stream
from website.constants import DIR_STATIC, DIR_STATIC_EXTERNAL, SEGMENT_INIT, CHAT_SCROLLBACK, BROADCASTER_COLOUR, BROADCASTER_TOKEN, SEGMENTS_DIR, VIEW_COUNTING_PERIOD, HLS_TIME, NOTES, N_NONE, MESSAGE_MAX_LENGTH
from website.constants import DIR_STATIC, DIR_STATIC_EXTERNAL, VIDEOJS_ENABLED_BY_DEFAULT, SEGMENT_INIT, CHAT_SCROLLBACK, BROADCASTER_COLOUR, BROADCASTER_TOKEN, SEGMENTS_DIR, VIEW_COUNTING_PERIOD, HLS_TIME, NOTES, N_NONE, MESSAGE_MAX_LENGTH
from website.concatenate import ConcatenatedSegments, resolve_segment_offset
viewers = viewership.viewers
@ -32,7 +32,7 @@ def index(token=None):
viewership.video_was_corrupted.remove(token)
except KeyError:
pass
use_videojs = bool(request.args.get('videojs', default=1, type=int))
use_videojs = bool(request.args.get('videojs', default=int(VIDEOJS_ENABLED_BY_DEFAULT), type=int))
viewership.made_request(token)
response = render_template('index.html',