@defcomm/meetingsdk 0.1.4 → 0.1.5

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.mjs CHANGED
@@ -1975,11 +1975,18 @@ var VideoSDKCore = class {
1975
1975
  },
1976
1976
  // SCREEN SHARE
1977
1977
  onScreenShareStarted: (participantId, _track) => {
1978
+ console.log("[SFU] Screen share started", participantId);
1979
+ this.state.setPresenterId(participantId);
1978
1980
  if (participantId === this.myId) {
1981
+ this.state.updateLocalParticipant({
1982
+ media: {
1983
+ isScreenSharing: true,
1984
+ screenStream: this.screenStream,
1985
+ screenTrack: this.screenStream?.getVideoTracks()[0]
1986
+ }
1987
+ });
1979
1988
  return;
1980
1989
  }
1981
- console.log("[SFU] Screen share started", participantId);
1982
- this.state.setPresenterId(participantId);
1983
1990
  const current = this.state.getParticipant(participantId);
1984
1991
  if (current) {
1985
1992
  this.state.updateParticipantMedia(participantId, {
@@ -1989,7 +1996,17 @@ var VideoSDKCore = class {
1989
1996
  }
1990
1997
  },
1991
1998
  onScreenShareStopped: (participantId) => {
1999
+ if (this.state.presenterId === participantId) {
2000
+ this.state.setPresenterId(null);
2001
+ }
1992
2002
  if (participantId === this.myId) {
2003
+ this.state.updateLocalParticipant({
2004
+ media: {
2005
+ isScreenSharing: false,
2006
+ screenStream: null,
2007
+ screenTrack: void 0
2008
+ }
2009
+ });
1993
2010
  return;
1994
2011
  }
1995
2012
  const screen = this.remoteScreenStreams.get(participantId);