@reactoo/watchtogether-sdk-js 2.6.83 → 2.6.85

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.
@@ -13,6 +13,7 @@
13
13
  <div>
14
14
  <button onclick="startRoom()">Connect and publish</button>
15
15
  <button onclick="startRoom2()">Connect and publish with screen share</button>
16
+ <button onclick="startRoom3()">Connect and publish with blank screen</button>
16
17
  <button onclick="disconnectRoom()">Disconnect</button>
17
18
  <button onclick="publish()">publish cam</button>
18
19
  <button onclick="publishBlankCam()">publish blank cam</button>
@@ -67,6 +68,7 @@
67
68
  this.removeParticipant({id: data.id})
68
69
 
69
70
  if(!data.stream) {
71
+ console.log('no stream for participant');
70
72
  return;
71
73
  }
72
74
 
@@ -120,6 +122,11 @@
120
122
  .then((stream) => sess.publishLocal(stream, 'screen'))
121
123
  }
122
124
 
125
+ function startRoom3() {
126
+ let sess = Instance.room.getSessionByConstructId(constructId);
127
+ sess.connect().then(() => sess.publishLocal(null, 'camera0'))
128
+ }
129
+
123
130
  function unpublish() {
124
131
  Instance.room.getSessionByConstructId(constructId).unpublishLocal()
125
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.6.83",
3
+ "version": "2.6.85",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -23,6 +23,10 @@ let user = function () {
23
23
  .then(([client, response]) => client.apis.user.publishMyAvatar({id, lastRoomId}))
24
24
  ;
25
25
  },
26
+ unsetAvatar: (lastRoomId) => {
27
+ return this.__privates.auth.__client
28
+ .then((client) => client.apis.user.publishMyAvatar({lastRoomId}));
29
+ },
26
30
  uploadReaction: (files) => {
27
31
  let id = generateUUID();
28
32
  return this.__privates.auth.__client
@@ -2534,7 +2534,7 @@ class RoomSession {
2534
2534
  config.stream = new MediaStream();
2535
2535
  }
2536
2536
 
2537
- let needsNegotiation = false;
2537
+ let needsNegotiation = !this.isPublished;
2538
2538
  let transceivers = config.pc.getTransceivers();
2539
2539
  let existingTracks = [...(config.streamMap[source] || [])];
2540
2540
 
@@ -2755,6 +2755,8 @@ class RoomSession {
2755
2755
  .then(() => emitEvents())
2756
2756
  }
2757
2757
 
2758
+ this._log('Starting negotiation');
2759
+
2758
2760
  return Promise
2759
2761
  .all([audioTrackReplacePromise, videoTrackReplacePromise])
2760
2762
  .then(() => this._createAO('offer', this.handleId, false))