2020-08-24 05:06:58 +03:00
|
|
|
// misc constants used throughout the app
|
|
|
|
|
2020-09-15 02:15:53 +03: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 03:26:23 +03:00
|
|
|
export const URL_VIEWER_PING = `/api/ping`;
|
2020-08-24 05:06:58 +03:00
|
|
|
|
2021-11-03 05:27:41 +03:00
|
|
|
// inline moderation actions
|
2022-06-20 18:46:53 +03:00
|
|
|
export const URL_HIDE_MESSAGE = `/api/chat/messagevisibility`;
|
2021-11-03 05:27:41 +03:00
|
|
|
export const URL_BAN_USER = `/api/chat/users/setenabled`;
|
|
|
|
|
2020-08-24 05:06:58 +03: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 05:23:06 +03:00
|
|
|
export const URL_WEBSOCKET = `${
|
2022-06-20 18:46:53 +03:00
|
|
|
location.protocol === 'https:' ? 'wss' : 'ws'
|
2021-07-20 05:23:06 +03:00
|
|
|
}://${location.host}/ws`;
|
2021-07-20 05:22:29 +03:00
|
|
|
export const URL_CHAT_REGISTRATION = `/api/chat/register`;
|
2022-01-13 00:53:10 +03:00
|
|
|
export const URL_FOLLOWERS = `/api/followers`;
|
2022-03-17 03:34:44 +03:00
|
|
|
export const URL_PLAYBACK_METRICS = `/api/metrics/playback`;
|
2020-08-24 05:06:58 +03:00
|
|
|
|
2022-03-18 23:33:23 +03:00
|
|
|
export const URL_REGISTER_NOTIFICATION = `/api/notifications/register`;
|
|
|
|
export const URL_REGISTER_EMAIL_NOTIFICATION = `/api/notifications/register/email`;
|
2022-04-22 00:55:26 +03:00
|
|
|
export const URL_CHAT_INDIEAUTH_BEGIN = `/api/auth/indieauth`;
|
2022-03-18 23:33:23 +03:00
|
|
|
|
2020-08-24 05:06:58 +03: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 06:29:32 +03:00
|
|
|
export const TEMP_IMAGE =
|
2022-06-20 18:46:53 +03:00
|
|
|
'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
2020-08-24 05:06:58 +03:00
|
|
|
|
2020-11-18 02:12:54 +03:00
|
|
|
export const OWNCAST_LOGO_LOCAL = '/img/logo.svg';
|
|
|
|
|
2020-08-24 05:06:58 +03:00
|
|
|
export const MESSAGE_OFFLINE = 'Stream is offline.';
|
2020-08-24 05:37:06 +03:00
|
|
|
export const MESSAGE_ONLINE = 'Stream is online.';
|
2020-08-24 05:06:58 +03:00
|
|
|
|
2020-08-24 08:21:42 +03:00
|
|
|
export const URL_OWNCAST = 'https://owncast.online'; // used in footer
|
2020-10-06 23:46:07 +03:00
|
|
|
export const PLAYER_VOLUME = 'owncast_volume';
|
2020-08-24 05:06:58 +03:00
|
|
|
|
2021-07-20 05:22:29 +03:00
|
|
|
export const KEY_ACCESS_TOKEN = 'owncast_access_token';
|
|
|
|
export const KEY_EMBED_CHAT_ACCESS_TOKEN = 'owncast_embed_chat_access_token';
|
2020-08-24 05:06:58 +03:00
|
|
|
export const KEY_USERNAME = 'owncast_username';
|
2021-05-21 06:29:32 +03:00
|
|
|
export const KEY_CUSTOM_USERNAME_SET = 'owncast_custom_username_set';
|
2020-08-24 05:06:58 +03:00
|
|
|
export const KEY_CHAT_DISPLAYED = 'owncast_chat';
|
|
|
|
export const KEY_CHAT_FIRST_MESSAGE_SENT = 'owncast_first_message_sent';
|
2021-05-21 06:29:32 +03:00
|
|
|
export const CHAT_INITIAL_PLACEHOLDER_TEXT =
|
2022-06-20 18:46:53 +03:00
|
|
|
'Type here to chat, no account necessary.';
|
2020-08-24 05:06:58 +03:00
|
|
|
export const CHAT_PLACEHOLDER_TEXT = 'Message';
|
|
|
|
export const CHAT_PLACEHOLDER_OFFLINE = 'Chat is offline.';
|
2020-09-22 06:11:09 +03:00
|
|
|
export const CHAT_MAX_MESSAGE_LENGTH = 500;
|
2021-07-20 05:22:29 +03:00
|
|
|
export const EST_SOCKET_PAYLOAD_BUFFER = 512;
|
2020-09-22 06:11:09 +03:00
|
|
|
export const CHAT_CHAR_COUNT_BUFFER = 20;
|
|
|
|
export const CHAT_OK_KEYCODES = [
|
2022-06-20 18:46:53 +03:00
|
|
|
'ArrowLeft',
|
|
|
|
'ArrowUp',
|
|
|
|
'ArrowRight',
|
|
|
|
'ArrowDown',
|
|
|
|
'Shift',
|
|
|
|
'Meta',
|
|
|
|
'Alt',
|
|
|
|
'Delete',
|
|
|
|
'Backspace',
|
2020-09-22 06:11:09 +03:00
|
|
|
];
|
2021-05-21 06:29:32 +03:00
|
|
|
export const CHAT_KEY_MODIFIERS = ['Control', 'Shift', 'Meta', 'Alt'];
|
2021-08-30 02:58:37 +03:00
|
|
|
export const MESSAGE_JUMPTOBOTTOM_BUFFER = 500;
|
2020-08-24 13:30:42 +03:00
|
|
|
|
|
|
|
// app styling
|
2022-01-21 01:31:53 +03:00
|
|
|
export const WIDTH_SINGLE_COL = 780;
|
2020-08-24 13:30:42 +03:00
|
|
|
export const HEIGHT_SHORT_WIDE = 500;
|
2020-09-23 03:09:55 +03:00
|
|
|
export const ORIENTATION_PORTRAIT = 'portrait';
|
|
|
|
export const ORIENTATION_LANDSCAPE = 'landscape';
|
2022-03-18 23:33:23 +03:00
|
|
|
|
|
|
|
// localstorage keys
|
|
|
|
export const HAS_DISPLAYED_NOTIFICATION_MODAL_KEY =
|
2022-06-20 18:46:53 +03:00
|
|
|
'HAS_DISPLAYED_NOTIFICATION_MODAL';
|
2022-03-18 23:33:23 +03:00
|
|
|
export const USER_VISIT_COUNT_KEY = 'USER_VISIT_COUNT';
|
|
|
|
export const USER_DISMISSED_ANNOYING_NOTIFICATION_POPUP_KEY =
|
2022-06-20 18:46:53 +03:00
|
|
|
'USER_DISMISSED_ANNOYING_NOTIFICATION_POPUP_KEY';
|