@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.265 → 1.0.266

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.
package/dist/index.d.ts CHANGED
@@ -68,6 +68,10 @@ export declare class OdysseySpatialComms extends EventManager {
68
68
  dxLocal?: number;
69
69
  }): void;
70
70
  updateMediaState(mediaState: MediaState): void;
71
+ /**
72
+ * Stop screenshare - closes producer and notifies all consumers
73
+ */
74
+ stopScreenShare(): Promise<void>;
71
75
  setListenerPosition(position: Position, orientation: {
72
76
  forwardX: number;
73
77
  forwardY: number;
package/dist/index.js CHANGED
@@ -225,6 +225,34 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
225
225
  });
226
226
  }
227
227
  }
228
+ /**
229
+ * Stop screenshare - closes producer and notifies all consumers
230
+ */
231
+ async stopScreenShare() {
232
+ if (!this.localParticipant || !this.room)
233
+ return;
234
+ // Close local screenshare track
235
+ const screenshareTrack = this.localParticipant.screenshareTrack;
236
+ if (screenshareTrack) {
237
+ screenshareTrack.stop();
238
+ this.localParticipant.screenshareTrack = null;
239
+ }
240
+ // Close local screenshare producer
241
+ for (const [producerId, producer] of this.localParticipant.producers) {
242
+ if (producer.appData?.isScreenshare) {
243
+ producer.close();
244
+ this.localParticipant.producers.delete(producerId);
245
+ break;
246
+ }
247
+ }
248
+ // Notify server to close screenshare and notify consumers
249
+ return new Promise((resolve) => {
250
+ this.socket.emit("stop-screenshare", { participantId: this.localParticipant.participantId }, () => {
251
+ this.localParticipant.mediaState.sharescreen = false;
252
+ resolve();
253
+ });
254
+ });
255
+ }
228
256
  setListenerPosition(position, orientation) {
229
257
  this.spatialAudioManager.setListenerPosition(position, orientation);
230
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newgameplusinc/odyssey-audio-video-sdk-dev",
3
- "version": "1.0.265",
3
+ "version": "1.0.266",
4
4
  "description": "Odyssey Spatial Audio & Video SDK using MediaSoup for real-time communication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",