@@ -228,53 +228,59 @@ const onUserPropertyUpdated = async (e, template) => {
228228 ** LowMeetJs
229229 */
230230
231- const DOMAIN = '8x8.vc'
232- const getOptions = ( ) => ( {
233- // Connection
234- hosts : {
235- domain : DOMAIN ,
236- muc : `conference.${ DOMAIN } ` ,
237- focus : `focus.${ DOMAIN } ` ,
238- } ,
239- serviceUrl : `wss://${ DOMAIN } /xmpp-websocket?room=${ meetLowLevel . roomName } ` ,
240- websocketKeepAliveUrl : `https://${ DOMAIN } /_unlock?room=${ meetLowLevel . roomName } ` ,
231+ const getOptions = ( ) => {
232+ const serverURL = Meteor . settings . public . meet . serverURL
233+
234+ if ( ! serverURL ) return
235+ const [ domain , sub ] = serverURL . split ( '/' )
236+
237+ return {
238+ // Connection
239+ hosts : {
240+ domain : serverURL ,
241+ muc : `conference.${ sub } .${ domain } ` ,
242+ focus : `focus.${ domain } ` ,
243+ } ,
244+ serviceUrl : `wss://${ serverURL } /xmpp-websocket?room=${ meetLowLevel . roomName } ` ,
245+ websocketKeepAliveUrl : `https://${ serverURL } /_unlock?room=${ meetLowLevel . roomName } ` ,
241246
242- // Enable Peer-to-Peer for 1-1 calls
243- p2p : {
244- enabled : false ,
245- } ,
247+ // Enable Peer-to-Peer for 1-1 calls
248+ p2p : {
249+ enabled : false ,
250+ } ,
246251
247- // Video quality / constraints
248- constraints : {
249- video : {
250- height : {
251- ideal : 720 ,
252- max : 720 ,
253- min : 180 ,
254- } ,
255- width : {
256- ideal : 1280 ,
257- max : 1280 ,
258- min : 320 ,
252+ // Video quality / constraints
253+ constraints : {
254+ video : {
255+ height : {
256+ ideal : 720 ,
257+ max : 720 ,
258+ min : 180 ,
259+ } ,
260+ width : {
261+ ideal : 1280 ,
262+ max : 1280 ,
263+ min : 320 ,
264+ } ,
259265 } ,
260266 } ,
261- } ,
262- channelLastN : 25 ,
267+ channelLastN : 25 ,
263268
264- // Logging
265- logging : {
266- // Default log level
267- defaultLogLevel : 'trace' ,
269+ // Logging
270+ logging : {
271+ // Default log level
272+ defaultLogLevel : 'trace' ,
268273
269- // The following are too verbose in their logging with the default level
270- 'modules/RTC/TraceablePeerConnection.js' : 'info' ,
271- 'modules/statistics/CallStats.js' : 'info' ,
272- 'modules/xmpp/strophe.util.js' : 'log' ,
273- } ,
274+ // The following are too verbose in their logging with the default level
275+ 'modules/RTC/TraceablePeerConnection.js' : 'info' ,
276+ 'modules/statistics/CallStats.js' : 'info' ,
277+ 'modules/xmpp/strophe.util.js' : 'log' ,
278+ } ,
274279
275- // End marker, disregard
276- __end : true ,
277- } )
280+ // End marker, disregard
281+ __end : true ,
282+ }
283+ }
278284
279285export const meetLowLevel = {
280286 connectionStarted : false ,
@@ -305,20 +311,22 @@ export const meetLowLevel = {
305311 } )
306312 . catch ( ( err ) => console . error ( 'An error occured while creating local tracks' , err ) )
307313
308- const connection = new jitsiMeetJS . JitsiConnection ( null , null , options )
314+ Meteor . call ( 'computeRoomToken' , this . roomName , ( err , token ) => {
315+ const connection = new jitsiMeetJS . JitsiConnection ( null , token , options )
309316
310- connection . addEventListener ( jitsiMeetJS . events . connection . CONNECTION_ESTABLISHED , ( ) => {
311- this . onConnectionSuccess ( )
312- } )
313- connection . addEventListener ( jitsiMeetJS . events . connection . CONNECTION_FAILED , ( ) => {
314- this . onConnectionFailed ( )
315- } )
316- connection . addEventListener ( jitsiMeetJS . events . connection . CONNECTION_DISCONNECTED , ( ) => {
317- this . onConnectionDisconnected ( )
318- } )
317+ connection . addEventListener ( jitsiMeetJS . events . connection . CONNECTION_ESTABLISHED , ( ) => {
318+ this . onConnectionSuccess ( )
319+ } )
320+ connection . addEventListener ( jitsiMeetJS . events . connection . CONNECTION_FAILED , ( ) => {
321+ this . onConnectionFailed ( )
322+ } )
323+ connection . addEventListener ( jitsiMeetJS . events . connection . CONNECTION_DISCONNECTED , ( ) => {
324+ this . onConnectionDisconnected ( )
325+ } )
319326
320- connection . connect ( )
321- this . template . connection . set ( connection )
327+ connection . connect ( )
328+ this . template . connection . set ( connection )
329+ } )
322330 }
323331 } ,
324332
0 commit comments