@flashphoner/websdk 2.0.217 → 2.0.218

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- Web SDK - 2.0.217
1
+ Web SDK - 2.0.218
2
2
 
3
3
  [Download builds](https://docs.flashphoner.com/display/WEBSDK2EN/Web+SDK+release+notes)
4
4
 
@@ -70,6 +70,7 @@ function onLeft() {
70
70
  function start() {
71
71
  var url = $('#url').val();
72
72
  var username = $('#login').val();
73
+ var display = document.getElementById("localDisplay");
73
74
  if (connection && connection.status() == SESSION_STATUS.ESTABLISHED) {
74
75
  //check url and username
75
76
  if (connection.getServerUrl() != url || connection.username() != username) {
@@ -81,7 +82,14 @@ function start() {
81
82
  return;
82
83
  }
83
84
  }
84
- createConnection(url, username);
85
+ // Requesting media access before connecting to the server #WCS-3449
86
+ Flashphoner.getMediaAccess(null, localDisplay).then(function() {
87
+ createConnection(url, username);
88
+ }).catch(function(error) {
89
+ console.error("User not allowed media access: "+error);
90
+ $("#failedInfo").text("User not allowed media access. Refresh the page");
91
+ onLeft();
92
+ });
85
93
  }
86
94
 
87
95
  function createConnection(url, username) {
@@ -140,6 +140,7 @@ function onLeft() {
140
140
  function start() {
141
141
  var url = $('#url').val();
142
142
  var username = $('#login').val();
143
+ var display = document.getElementById("localDisplay");
143
144
  if (connection && connection.status() == SESSION_STATUS.ESTABLISHED) {
144
145
  //check url and username
145
146
  if (connection.getServerUrl() != url || connection.username() != username) {
@@ -151,6 +152,17 @@ function start() {
151
152
  return;
152
153
  }
153
154
  }
155
+ // Requesting media access before connecting to the server #WCS-3449
156
+ Flashphoner.getMediaAccess(null, localDisplay).then(function() {
157
+ createConnection(url, username);
158
+ }).catch(function(error) {
159
+ console.error("User not allowed media access: "+error);
160
+ $("#failedInfo").text("User not allowed media access. Refresh the page");
161
+ onLeft();
162
+ });
163
+ }
164
+
165
+ function createConnection(url, username) {
154
166
  connection = RoomApi.connect({urlServer: url, username: username}).on(SESSION_STATUS.FAILED, function(session){
155
167
  setStatus('#status', session.status());
156
168
  onLeft();
@@ -10383,7 +10383,7 @@ var createSession = function createSession(options) {
10383
10383
  mediaProviders: Object.keys(MediaProvider),
10384
10384
  keepAlive: keepAlive,
10385
10385
  authToken: authToken,
10386
- clientVersion: "2.0.217",
10386
+ clientVersion: "2.0.218",
10387
10387
  clientOSVersion: window.navigator.appVersion,
10388
10388
  clientBrowserVersion: window.navigator.userAgent,
10389
10389
  msePacketizationVersion: 2,