Browse Source

make websocket and stream use constants (#584)

pull/592/head
Aaron Ogle 4 years ago committed by GitHub
parent
commit
caa32fa248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      webroot/js/components/player.js
  2. 2
      webroot/js/utils/websocket.js

3
webroot/js/components/player.js

@ -3,10 +3,9 @@ @@ -3,10 +3,9 @@
import videojs from '/js/web_modules/videojs/core.js';
import '/js/web_modules/@videojs/http-streaming/dist/videojs-http-streaming.min.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 URL_STREAM = `/hls/stream.m3u8`;
// Video setup
const VIDEO_SRC = {

2
webroot/js/utils/websocket.js

@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
import { URL_WEBSOCKET } from './constants.js';
/**
* 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
@ -17,7 +18,6 @@ export const CALLBACKS = { @@ -17,7 +18,6 @@ export const CALLBACKS = {
WEBSOCKET_DISCONNECTED: 'websocketDisconnected',
}
const URL_WEBSOCKET = `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/entry`;
const TIMER_WEBSOCKET_RECONNECT = 5000; // ms
export default class Websocket {

Loading…
Cancel
Save