make websocket and stream use constants (#584)

This commit is contained in:
Aaron Ogle
2021-01-05 00:30:18 -06:00
committed by GitHub
parent 0ea5a51e90
commit caa32fa248
2 changed files with 2 additions and 3 deletions

View File

@@ -3,10 +3,9 @@
import videojs from '/js/web_modules/videojs/core.js'; import videojs from '/js/web_modules/videojs/core.js';
import '/js/web_modules/@videojs/http-streaming/dist/videojs-http-streaming.min.js'; import '/js/web_modules/@videojs/http-streaming/dist/videojs-http-streaming.min.js';
import { getLocalStorage, setLocalStorage } from '../utils/helpers.js'; import { getLocalStorage, setLocalStorage } from '../utils/helpers.js';
import { PLAYER_VOLUME } from '../utils/constants.js'; import { PLAYER_VOLUME, URL_STREAM } from '../utils/constants.js';
const VIDEO_ID = 'video'; const VIDEO_ID = 'video';
const URL_STREAM = `/hls/stream.m3u8`;
// Video setup // Video setup
const VIDEO_SRC = { const VIDEO_SRC = {

View File

@@ -1,3 +1,4 @@
import { URL_WEBSOCKET } from './constants.js';
/** /**
* These are the types of messages that we can handle with the websocket. * These are the types of messages that we can handle with the websocket.
* Mostly used by `websocket.js` but if other components need to handle * Mostly used by `websocket.js` but if other components need to handle
@@ -17,7 +18,6 @@ export const CALLBACKS = {
WEBSOCKET_DISCONNECTED: 'websocketDisconnected', WEBSOCKET_DISCONNECTED: 'websocketDisconnected',
} }
const URL_WEBSOCKET = `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/entry`;
const TIMER_WEBSOCKET_RECONNECT = 5000; // ms const TIMER_WEBSOCKET_RECONNECT = 5000; // ms
export default class Websocket { export default class Websocket {