@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.js CHANGED
@@ -2011,11 +2011,18 @@ var VideoSDKCore = class {
2011
2011
  },
2012
2012
  // SCREEN SHARE
2013
2013
  onScreenShareStarted: (participantId, _track) => {
2014
+ console.log("[SFU] Screen share started", participantId);
2015
+ this.state.setPresenterId(participantId);
2014
2016
  if (participantId === this.myId) {
2017
+ this.state.updateLocalParticipant({
2018
+ media: {
2019
+ isScreenSharing: true,
2020
+ screenStream: this.screenStream,
2021
+ screenTrack: this.screenStream?.getVideoTracks()[0]
2022
+ }
2023
+ });
2015
2024
  return;
2016
2025
  }
2017
- console.log("[SFU] Screen share started", participantId);
2018
- this.state.setPresenterId(participantId);
2019
2026
  const current = this.state.getParticipant(participantId);
2020
2027
  if (current) {
2021
2028
  this.state.updateParticipantMedia(participantId, {
@@ -2025,7 +2032,17 @@ var VideoSDKCore = class {
2025
2032
  }
2026
2033
  },
2027
2034
  onScreenShareStopped: (participantId) => {
2035
+ if (this.state.presenterId === participantId) {
2036
+ this.state.setPresenterId(null);
2037
+ }
2028
2038
  if (participantId === this.myId) {
2039
+ this.state.updateLocalParticipant({
2040
+ media: {
2041
+ isScreenSharing: false,
2042
+ screenStream: null,
2043
+ screenTrack: void 0
2044
+ }
2045
+ });
2029
2046
  return;
2030
2047
  }
2031
2048
  const screen = this.remoteScreenStreams.get(participantId);