2020-08-24 04:06:58 +02:00
|
|
|
// misc constants used throughout the app
|
|
|
|
|
2020-09-15 01:15:53 +02:00
|
|
|
export const URL_STATUS = `/api/status`;
|
|
|
|
export const URL_CHAT_HISTORY = `/api/chat`;
|
|
|
|
export const URL_CUSTOM_EMOJIS = `/api/emoji`;
|
|
|
|
export const URL_CONFIG = `/api/config`;
|
2021-06-21 02:26:23 +02:00
|
|
|
export const URL_VIEWER_PING = `/api/ping`;
|
2020-08-24 04:06:58 +02:00
|
|
|
|
2021-11-03 03:27:41 +01:00
|
|
|
// inline moderation actions
|
|
|
|
export const URL_HIDE_MESSAGE = `/api/chat/updatemessagevisibility`;
|
|
|
|
export const URL_BAN_USER = `/api/chat/users/setenabled`;
|
|
|
|
|
2020-08-24 04:06:58 +02:00
|
|
|
// TODO: This directory is customizable in the config. So we should expose this via the config API.
|
|
|
|
export const URL_STREAM = `/hls/stream.m3u8`;
|
2021-07-20 04:23:06 +02:00
|
|
|
export const URL_WEBSOCKET = `${
|
|
|
|
location.protocol === 'https:' ? 'wss' : 'ws'
|
|
|
|
}://${location.host}/ws`;
|
2021-07-20 04:22:29 +02:00
|
|
|
export const URL_CHAT_REGISTRATION = `/api/chat/register`;
|
2020-08-24 04:06:58 +02:00
|
|
|
|
|
|
|
export const TIMER_STATUS_UPDATE = 5000; // ms
|
|
|
|
export const TIMER_DISABLE_CHAT_AFTER_OFFLINE = 5 * 60 * 1000; // 5 mins
|
|
|
|
export const TIMER_STREAM_DURATION_COUNTER = 1000;
|
2021-05-21 05:29:32 +02:00
|
|
|
export const TEMP_IMAGE =
|
|
|
|
'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
2020-08-24 04:06:58 +02:00
|
|
|
|
2020-11-18 00:12:54 +01:00
|
|
|
export const OWNCAST_LOGO_LOCAL = '/img/logo.svg';
|
|
|
|
|
2020-08-24 04:06:58 +02:00
|
|
|
export const MESSAGE_OFFLINE = 'Stream is offline.';
|
2020-08-24 04:37:06 +02:00
|
|
|
export const MESSAGE_ONLINE = 'Stream is online.';
|
2020-08-24 04:06:58 +02:00
|
|
|
|
2020-08-24 07:21:42 +02:00
|
|
|
export const URL_OWNCAST = 'https://owncast.online'; // used in footer
|
2020-10-06 22:46:07 +02:00
|
|
|
export const PLAYER_VOLUME = 'owncast_volume';
|
2020-08-24 04:06:58 +02:00
|
|
|
|
2021-07-20 04:22:29 +02:00
|
|
|
export const KEY_ACCESS_TOKEN = 'owncast_access_token';
|
|
|
|
export const KEY_EMBED_CHAT_ACCESS_TOKEN = 'owncast_embed_chat_access_token';
|
2020-08-24 04:06:58 +02:00
|
|
|
export const KEY_USERNAME = 'owncast_username';
|
2021-05-21 05:29:32 +02:00
|
|
|
export const KEY_CUSTOM_USERNAME_SET = 'owncast_custom_username_set';
|
2020-08-24 04:06:58 +02:00
|
|
|
export const KEY_CHAT_DISPLAYED = 'owncast_chat';
|
|
|
|
export const KEY_CHAT_FIRST_MESSAGE_SENT = 'owncast_first_message_sent';
|
2021-05-21 05:29:32 +02:00
|
|
|
export const CHAT_INITIAL_PLACEHOLDER_TEXT =
|
|
|
|
'Type here to chat, no account necessary.';
|
2020-08-24 04:06:58 +02:00
|
|
|
export const CHAT_PLACEHOLDER_TEXT = 'Message';
|
|
|
|
export const CHAT_PLACEHOLDER_OFFLINE = 'Chat is offline.';
|
2020-09-22 05:11:09 +02:00
|
|
|
export const CHAT_MAX_MESSAGE_LENGTH = 500;
|
2021-07-20 04:22:29 +02:00
|
|
|
export const EST_SOCKET_PAYLOAD_BUFFER = 512;
|
2020-09-22 05:11:09 +02:00
|
|
|
export const CHAT_CHAR_COUNT_BUFFER = 20;
|
|
|
|
export const CHAT_OK_KEYCODES = [
|
|
|
|
'ArrowLeft',
|
|
|
|
'ArrowUp',
|
|
|
|
'ArrowRight',
|
|
|
|
'ArrowDown',
|
|
|
|
'Shift',
|
|
|
|
'Meta',
|
|
|
|
'Alt',
|
|
|
|
'Delete',
|
|
|
|
'Backspace',
|
|
|
|
];
|
2021-05-21 05:29:32 +02:00
|
|
|
export const CHAT_KEY_MODIFIERS = ['Control', 'Shift', 'Meta', 'Alt'];
|
2021-08-30 01:58:37 +02:00
|
|
|
export const MESSAGE_JUMPTOBOTTOM_BUFFER = 500;
|
2020-08-24 12:30:42 +02:00
|
|
|
|
|
|
|
// app styling
|
|
|
|
export const WIDTH_SINGLE_COL = 730;
|
|
|
|
export const HEIGHT_SHORT_WIDE = 500;
|
2020-09-23 02:09:55 +02:00
|
|
|
export const ORIENTATION_PORTRAIT = 'portrait';
|
|
|
|
export const ORIENTATION_LANDSCAPE = 'landscape';
|