webex/webex-js-sdk

Samples directory - Samples are initialized with a meetings config object with a deviceType property that serves no purpose and can could be confusing to user

jdaly13 opened this issue · 3 comments

Expected Behavior

When a user initializes a webex instance in an example app it should have no config object unless we want to set a different property other than deviceType on meetings

      webex = window.webex = Webex.init({
        credentials: {
          access_token: document.getElementById('access-token').value
        }
      });

Current Behavior

      webex = window.webex = Webex.init({
        config: {
          meetings: {
            deviceType: 'WEB'
          }
          // Any other sdk config we need
        },
        credentials: {
          access_token: document.getElementById('access-token').value
        }
      });

Current config object doesn't set any properties that aren't already set and may be confusing to user because deviceType probably shouldn't be changed and they may try to initiate deviceType in their integration.

Possible Solution (we welcome any logical suggestion)

We should remove config objects from all examples in samples directory or possibly add a new meetings config object that changes a different property so users know what the available options are

Also Is it possible in the future to list other useful options user could override like
maxReconnectAttempts or onBeforeLogout in the main config and explain what they do?
But you can also override meetings config property as well - do we want to put any examples in there as well? for example

config: { meetings: { screenFrameRate:20 } }

Currently in the meetings plugin the registerPlugin function takes in a config file which is a meetings object which has various settings. Are all these settings meant to be editable? If deviceType is not editable can we define that property as frozen
Object.defineProperty(meetings, "deviceType", { configurable: false, writable: false });

so now I see attrs.config can override config in initialize so you can override the config file when initializing - but for the examples in samples folder we don't need the meetings config object if there are no properties to change? Is there one we could change?

Also there is a TODO in config file related to jira ticket not sure if it's related at all
https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-73167

Fix in PR #1681