@cloudflare/realtimekit-ui 2.1.1-staging.1 → 2.2.0-staging.1

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.
@@ -22,6 +22,19 @@ const RtkScreenshareView = class {
22
22
  index$1.registerInstance(this, hostRef);
23
23
  this.stateUpdate = index$1.createEvent(this, "rtkStateUpdate", 7);
24
24
  this.play = index$1.createEvent(this, "screensharePlay", 7);
25
+ this.screenShareListener = ({ screenShareEnabled, screenShareTracks, }) => {
26
+ const enabled = screenShareEnabled && screenShareTracks.video != null;
27
+ index$1.writeTask(() => {
28
+ this.screenShareEnabled = enabled;
29
+ });
30
+ };
31
+ this.onVideoRef = (el) => {
32
+ var _a;
33
+ if (el == null || el === this.videoEl)
34
+ return;
35
+ this.videoEl = el;
36
+ (_a = this.participant) === null || _a === void 0 ? void 0 : _a.registerScreenshareVideoElement(el);
37
+ };
25
38
  this.fullScreenListener = () => {
26
39
  this.isFullScreen = fullScreen.isFullScreenEnabled();
27
40
  };
@@ -73,47 +86,40 @@ const RtkScreenshareView = class {
73
86
  connectedCallback() {
74
87
  window === null || window === void 0 ? void 0 : window.addEventListener('fullscreenchange', this.fullScreenListener);
75
88
  window === null || window === void 0 ? void 0 : window.addEventListener('webkitfullscreenchange', this.fullScreenListener);
76
- }
77
- componentDidLoad() {
78
89
  this.participantChanged(this.participant);
79
90
  }
80
91
  disconnectedCallback() {
92
+ this.cleanupParticipant(this.participant);
93
+ window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
94
+ window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
95
+ }
96
+ participantChanged(participant, oldParticipant) {
97
+ // The SDK ignores a video element that another participant still manages
98
+ this.cleanupParticipant(oldParticipant);
99
+ if (participant == null)
100
+ return;
101
+ // On first load the video element is registered once it renders, see onVideoRef
102
+ if (this.videoEl)
103
+ participant.registerScreenshareVideoElement(this.videoEl);
81
104
  if (!this.meeting)
82
105
  return;
83
- const { self } = this.meeting;
84
- if (this.participant.id === self.id && this.screenShareListener)
85
- this.participant.removeListener('screenShareUpdate', this.screenShareListener);
106
+ this.screenShareListener(participant);
107
+ if (participant.id === this.meeting.self.id)
108
+ participant.addListener('screenShareUpdate', this.screenShareListener);
86
109
  else
87
- this.meeting.participants.joined.removeListener('screenShareUpdate', this.participantScreenshareUpdate);
88
- window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
89
- window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
110
+ this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
90
111
  }
91
- participantChanged(participant) {
92
- if (participant != null && this.meeting) {
93
- const { self } = this.meeting;
94
- this.screenShareListener = ({ screenShareEnabled, screenShareTracks }) => {
95
- const enabled = screenShareEnabled && screenShareTracks.video != null;
96
- index$1.writeTask(() => {
97
- this.screenShareEnabled = enabled;
98
- });
99
- if (enabled) {
100
- const stream = new MediaStream();
101
- stream.addTrack(screenShareTracks.video);
102
- if (this.videoEl != null) {
103
- this.videoEl.srcObject = stream;
104
- this.videoEl.play();
105
- }
106
- }
107
- else if (this.videoEl != null) {
108
- this.videoEl.srcObject = undefined;
109
- }
110
- };
111
- this.screenShareListener(participant);
112
- if (participant.id === self.id)
113
- participant.addListener('screenShareUpdate', this.screenShareListener);
114
- else
115
- this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
116
- }
112
+ cleanupParticipant(participant) {
113
+ if (participant == null)
114
+ return;
115
+ if (this.videoEl)
116
+ participant.deregisterScreenshareVideoElement(this.videoEl);
117
+ if (!this.meeting)
118
+ return;
119
+ if (participant.id === this.meeting.self.id)
120
+ participant.removeListener('screenShareUpdate', this.screenShareListener);
121
+ else
122
+ this.meeting.participants.joined.removeListener('screenShareUpdate', this.participantScreenshareUpdate);
117
123
  }
118
124
  render() {
119
125
  var _a, _b, _c;
@@ -122,7 +128,7 @@ const RtkScreenshareView = class {
122
128
  const icon = this.isFullScreen
123
129
  ? this.iconPack.full_screen_minimize
124
130
  : this.iconPack.full_screen_maximize;
125
- return (index$1.h(index$1.Host, { key: '0de66f829d0426af746b72561e7470c50c703060', class: { isSelf } }, index$1.h("div", { key: "video-container", id: "video-container", class: { expand: this.videoExpanded } }, index$1.h("video", { key: '2e56da582533ee6a8286483fa4495ff9a88453a0', ref: (el) => (this.videoEl = el), class: {
131
+ return (index$1.h(index$1.Host, { key: '194efb9fa8783a441c8050ebab07a2d3546446bf', class: { isSelf } }, index$1.h("div", { key: "video-container", id: "video-container", class: { expand: this.videoExpanded } }, index$1.h("video", { key: 'de008c1a856ba19e766c03b71b1be492a9975261', ref: this.onVideoRef, class: {
126
132
  visible: this.screenShareEnabled,
127
133
  'fit-in-container': this.participant.supportsRemoteControl,
128
134
  }, playsInline: true, onPlay: () => {
@@ -130,15 +136,15 @@ const RtkScreenshareView = class {
130
136
  screenshareParticipant: this.participant,
131
137
  participant: this.meeting.self,
132
138
  });
133
- }, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), index$1.h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && fullScreen.isFullScreenSupported() && (index$1.h("rtk-tooltip", { key: '7cd30b509e71685bb28615fd0eeb289764bc6f4b', label: text }, index$1.h("rtk-button", { key: '0610dd55ad5a29cdbb77c61ed024253a70c66020', id: "full-screen-btn", kind: "icon", onClick: this.toggleFullScreen, title: text }, index$1.h("rtk-icon", { key: '1ea3a04938cb5836afcf171fa881916f1a63da79', icon: icon, "aria-hidden": true, tabIndex: -1 }))))), isSelf && (index$1.h("div", { id: "self-message", key: "self-message" }, index$1.h("h3", { key: '4758cad86ab2453cbfbf9276e9db8f4f45889e4a' }, this.t('screenshare.shared')), index$1.h("div", { key: '136f80c0f74bbc9d860dfc9a5f2f04531dc9fe80', class: "actions" }, this.meeting != null && (index$1.h("rtk-button", { key: '2588174e0054805565c0ae9d3d7001d812c25d6c', variant: "danger", onClick: () => {
139
+ }, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), index$1.h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && fullScreen.isFullScreenSupported() && (index$1.h("rtk-tooltip", { key: 'bf9a96bcba99bb9cf13bbcf572e5a9b71d53498b', label: text }, index$1.h("rtk-button", { key: '06a5eb9396056114d9e1a339454e782b9c533a9b', id: "full-screen-btn", kind: "icon", onClick: this.toggleFullScreen, title: text }, index$1.h("rtk-icon", { key: 'fa4e499769a910ceb9b2bffa6668db83adbad135', icon: icon, "aria-hidden": true, tabIndex: -1 }))))), isSelf && (index$1.h("div", { id: "self-message", key: "self-message" }, index$1.h("h3", { key: '1650592e64dd44004a53ccc168ab7138c78ea7f4' }, this.t('screenshare.shared')), index$1.h("div", { key: 'd09216ab62012e1d2d445b8f080ae18786fc197e', class: "actions" }, this.meeting != null && (index$1.h("rtk-button", { key: 'f4e8c65eaaf40190eb566eb473d7932411731793', variant: "danger", onClick: () => {
134
140
  this.meeting.self.disableScreenShare();
135
- } }, index$1.h("rtk-icon", { key: '10de1c2c538cc069d5ea9c4a8e89699cdb06e970', icon: this.iconPack.share_screen_stop, slot: "start" }), this.t('screenshare.stop'))), this.meeting != null && (index$1.h("rtk-button", { key: '916802524a950adadd39eac97660d05034840a8b', variant: "secondary", disabled: this.isSwitchingScreen, onClick: this.shareDifferentScreen }, index$1.h("rtk-icon", { key: '5142a5fe580a7c900d7435e5c638bef0533a289b', icon: (_c = this.iconPack.share_screen_different) !== null && _c !== void 0 ? _c : this.iconPack.share_screen_start, slot: "start" }), this.t('screenshare.share_different_screen'))), index$1.h("rtk-button", { key: '6b024ca8b2b537b84862f96f35ab1e2a9832c974', variant: "secondary", id: "expand-btn", onClick: () => {
141
+ } }, index$1.h("rtk-icon", { key: '215fd1e658442e6f9c70ee5f7cabcd22e0901886', icon: this.iconPack.share_screen_stop, slot: "start" }), this.t('screenshare.stop'))), this.meeting != null && (index$1.h("rtk-button", { key: 'a73b3774901661020ef20e9e48dc81a4277cc471', variant: "secondary", disabled: this.isSwitchingScreen, onClick: this.shareDifferentScreen }, index$1.h("rtk-icon", { key: 'f9a4304e8cb648f5f2ca6ee650f6b512e86f1833', icon: (_c = this.iconPack.share_screen_different) !== null && _c !== void 0 ? _c : this.iconPack.share_screen_start, slot: "start" }), this.t('screenshare.share_different_screen'))), index$1.h("rtk-button", { key: 'b2f93bd50018b9a727860014d0d4c33ab8a23334', variant: "secondary", id: "expand-btn", onClick: () => {
136
142
  this.videoExpanded = !this.videoExpanded;
137
- } }, index$1.h("rtk-icon", { key: 'aef5ba226ba681c6ec6d11f0ac78c03329a88f27', icon: this.videoExpanded
143
+ } }, index$1.h("rtk-icon", { key: '40d5bb9a3dfc648035b946ced0c584b3a6312100', icon: this.videoExpanded
138
144
  ? this.iconPack.full_screen_minimize
139
145
  : this.iconPack.full_screen_maximize, slot: "start" }), this.videoExpanded
140
146
  ? this.t('screenshare.min_preview')
141
- : this.t('screenshare.max_preview'))))), index$1.h("slot", { key: 'f21ad85d1847864f268d1fa33235467f14de2420' })));
147
+ : this.t('screenshare.max_preview'))))), index$1.h("slot", { key: 'a2908fef4320f0bf4408a6a07d2ba4bea0acdc4c' })));
142
148
  }
143
149
  get host() { return index$1.getElement(this); }
144
150
  static get watchers() { return {
@@ -942,7 +942,7 @@ var merge = createAssigner(function(object, source, srcIndex) {
942
942
  * The literal below is replaced with the released package version by `prepublish.js`.
943
943
  * Builds that are not published (local, dev) report it as is.
944
944
  */
945
- const UI_KIT_VERSION = '2.1.1-staging.1';
945
+ const UI_KIT_VERSION = '2.2.0-staging.1';
946
946
  /**
947
947
  * The wrapper packages load components from the loader bundle, which carries its own copy of
948
948
  * this module, separate from the copy behind the main entry. The registered symbol is the one
@@ -22,6 +22,19 @@ import { SyncWithStore } from "../../utils/sync-with-store";
22
22
  */
23
23
  export class RtkScreenshareView {
24
24
  constructor() {
25
+ this.screenShareListener = ({ screenShareEnabled, screenShareTracks, }) => {
26
+ const enabled = screenShareEnabled && screenShareTracks.video != null;
27
+ writeTask(() => {
28
+ this.screenShareEnabled = enabled;
29
+ });
30
+ };
31
+ this.onVideoRef = (el) => {
32
+ var _a;
33
+ if (el == null || el === this.videoEl)
34
+ return;
35
+ this.videoEl = el;
36
+ (_a = this.participant) === null || _a === void 0 ? void 0 : _a.registerScreenshareVideoElement(el);
37
+ };
25
38
  this.fullScreenListener = () => {
26
39
  this.isFullScreen = isFullScreenEnabled();
27
40
  };
@@ -73,47 +86,40 @@ export class RtkScreenshareView {
73
86
  connectedCallback() {
74
87
  window === null || window === void 0 ? void 0 : window.addEventListener('fullscreenchange', this.fullScreenListener);
75
88
  window === null || window === void 0 ? void 0 : window.addEventListener('webkitfullscreenchange', this.fullScreenListener);
76
- }
77
- componentDidLoad() {
78
89
  this.participantChanged(this.participant);
79
90
  }
80
91
  disconnectedCallback() {
92
+ this.cleanupParticipant(this.participant);
93
+ window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
94
+ window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
95
+ }
96
+ participantChanged(participant, oldParticipant) {
97
+ // The SDK ignores a video element that another participant still manages
98
+ this.cleanupParticipant(oldParticipant);
99
+ if (participant == null)
100
+ return;
101
+ // On first load the video element is registered once it renders, see onVideoRef
102
+ if (this.videoEl)
103
+ participant.registerScreenshareVideoElement(this.videoEl);
81
104
  if (!this.meeting)
82
105
  return;
83
- const { self } = this.meeting;
84
- if (this.participant.id === self.id && this.screenShareListener)
85
- this.participant.removeListener('screenShareUpdate', this.screenShareListener);
106
+ this.screenShareListener(participant);
107
+ if (participant.id === this.meeting.self.id)
108
+ participant.addListener('screenShareUpdate', this.screenShareListener);
86
109
  else
87
- this.meeting.participants.joined.removeListener('screenShareUpdate', this.participantScreenshareUpdate);
88
- window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
89
- window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
110
+ this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
90
111
  }
91
- participantChanged(participant) {
92
- if (participant != null && this.meeting) {
93
- const { self } = this.meeting;
94
- this.screenShareListener = ({ screenShareEnabled, screenShareTracks }) => {
95
- const enabled = screenShareEnabled && screenShareTracks.video != null;
96
- writeTask(() => {
97
- this.screenShareEnabled = enabled;
98
- });
99
- if (enabled) {
100
- const stream = new MediaStream();
101
- stream.addTrack(screenShareTracks.video);
102
- if (this.videoEl != null) {
103
- this.videoEl.srcObject = stream;
104
- this.videoEl.play();
105
- }
106
- }
107
- else if (this.videoEl != null) {
108
- this.videoEl.srcObject = undefined;
109
- }
110
- };
111
- this.screenShareListener(participant);
112
- if (participant.id === self.id)
113
- participant.addListener('screenShareUpdate', this.screenShareListener);
114
- else
115
- this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
116
- }
112
+ cleanupParticipant(participant) {
113
+ if (participant == null)
114
+ return;
115
+ if (this.videoEl)
116
+ participant.deregisterScreenshareVideoElement(this.videoEl);
117
+ if (!this.meeting)
118
+ return;
119
+ if (participant.id === this.meeting.self.id)
120
+ participant.removeListener('screenShareUpdate', this.screenShareListener);
121
+ else
122
+ this.meeting.participants.joined.removeListener('screenShareUpdate', this.participantScreenshareUpdate);
117
123
  }
118
124
  render() {
119
125
  var _a, _b, _c;
@@ -122,7 +128,7 @@ export class RtkScreenshareView {
122
128
  const icon = this.isFullScreen
123
129
  ? this.iconPack.full_screen_minimize
124
130
  : this.iconPack.full_screen_maximize;
125
- return (h(Host, { key: '0de66f829d0426af746b72561e7470c50c703060', class: { isSelf } }, h("div", { key: "video-container", id: "video-container", class: { expand: this.videoExpanded } }, h("video", { key: '2e56da582533ee6a8286483fa4495ff9a88453a0', ref: (el) => (this.videoEl = el), class: {
131
+ return (h(Host, { key: '194efb9fa8783a441c8050ebab07a2d3546446bf', class: { isSelf } }, h("div", { key: "video-container", id: "video-container", class: { expand: this.videoExpanded } }, h("video", { key: 'de008c1a856ba19e766c03b71b1be492a9975261', ref: this.onVideoRef, class: {
126
132
  visible: this.screenShareEnabled,
127
133
  'fit-in-container': this.participant.supportsRemoteControl,
128
134
  }, playsInline: true, onPlay: () => {
@@ -130,15 +136,15 @@ export class RtkScreenshareView {
130
136
  screenshareParticipant: this.participant,
131
137
  participant: this.meeting.self,
132
138
  });
133
- }, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && isFullScreenSupported() && (h("rtk-tooltip", { key: '7cd30b509e71685bb28615fd0eeb289764bc6f4b', label: text }, h("rtk-button", { key: '0610dd55ad5a29cdbb77c61ed024253a70c66020', id: "full-screen-btn", kind: "icon", onClick: this.toggleFullScreen, title: text }, h("rtk-icon", { key: '1ea3a04938cb5836afcf171fa881916f1a63da79', icon: icon, "aria-hidden": true, tabIndex: -1 }))))), isSelf && (h("div", { id: "self-message", key: "self-message" }, h("h3", { key: '4758cad86ab2453cbfbf9276e9db8f4f45889e4a' }, this.t('screenshare.shared')), h("div", { key: '136f80c0f74bbc9d860dfc9a5f2f04531dc9fe80', class: "actions" }, this.meeting != null && (h("rtk-button", { key: '2588174e0054805565c0ae9d3d7001d812c25d6c', variant: "danger", onClick: () => {
139
+ }, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && isFullScreenSupported() && (h("rtk-tooltip", { key: 'bf9a96bcba99bb9cf13bbcf572e5a9b71d53498b', label: text }, h("rtk-button", { key: '06a5eb9396056114d9e1a339454e782b9c533a9b', id: "full-screen-btn", kind: "icon", onClick: this.toggleFullScreen, title: text }, h("rtk-icon", { key: 'fa4e499769a910ceb9b2bffa6668db83adbad135', icon: icon, "aria-hidden": true, tabIndex: -1 }))))), isSelf && (h("div", { id: "self-message", key: "self-message" }, h("h3", { key: '1650592e64dd44004a53ccc168ab7138c78ea7f4' }, this.t('screenshare.shared')), h("div", { key: 'd09216ab62012e1d2d445b8f080ae18786fc197e', class: "actions" }, this.meeting != null && (h("rtk-button", { key: 'f4e8c65eaaf40190eb566eb473d7932411731793', variant: "danger", onClick: () => {
134
140
  this.meeting.self.disableScreenShare();
135
- } }, h("rtk-icon", { key: '10de1c2c538cc069d5ea9c4a8e89699cdb06e970', icon: this.iconPack.share_screen_stop, slot: "start" }), this.t('screenshare.stop'))), this.meeting != null && (h("rtk-button", { key: '916802524a950adadd39eac97660d05034840a8b', variant: "secondary", disabled: this.isSwitchingScreen, onClick: this.shareDifferentScreen }, h("rtk-icon", { key: '5142a5fe580a7c900d7435e5c638bef0533a289b', icon: (_c = this.iconPack.share_screen_different) !== null && _c !== void 0 ? _c : this.iconPack.share_screen_start, slot: "start" }), this.t('screenshare.share_different_screen'))), h("rtk-button", { key: '6b024ca8b2b537b84862f96f35ab1e2a9832c974', variant: "secondary", id: "expand-btn", onClick: () => {
141
+ } }, h("rtk-icon", { key: '215fd1e658442e6f9c70ee5f7cabcd22e0901886', icon: this.iconPack.share_screen_stop, slot: "start" }), this.t('screenshare.stop'))), this.meeting != null && (h("rtk-button", { key: 'a73b3774901661020ef20e9e48dc81a4277cc471', variant: "secondary", disabled: this.isSwitchingScreen, onClick: this.shareDifferentScreen }, h("rtk-icon", { key: 'f9a4304e8cb648f5f2ca6ee650f6b512e86f1833', icon: (_c = this.iconPack.share_screen_different) !== null && _c !== void 0 ? _c : this.iconPack.share_screen_start, slot: "start" }), this.t('screenshare.share_different_screen'))), h("rtk-button", { key: 'b2f93bd50018b9a727860014d0d4c33ab8a23334', variant: "secondary", id: "expand-btn", onClick: () => {
136
142
  this.videoExpanded = !this.videoExpanded;
137
- } }, h("rtk-icon", { key: 'aef5ba226ba681c6ec6d11f0ac78c03329a88f27', icon: this.videoExpanded
143
+ } }, h("rtk-icon", { key: '40d5bb9a3dfc648035b946ced0c584b3a6312100', icon: this.videoExpanded
138
144
  ? this.iconPack.full_screen_minimize
139
145
  : this.iconPack.full_screen_maximize, slot: "start" }), this.videoExpanded
140
146
  ? this.t('screenshare.min_preview')
141
- : this.t('screenshare.max_preview'))))), h("slot", { key: 'f21ad85d1847864f268d1fa33235467f14de2420' })));
147
+ : this.t('screenshare.max_preview'))))), h("slot", { key: 'a2908fef4320f0bf4408a6a07d2ba4bea0acdc4c' })));
142
148
  }
143
149
  static get is() { return "rtk-screenshare-view"; }
144
150
  static get encapsulation() { return "shadow"; }
@@ -2,7 +2,7 @@
2
2
  * The literal below is replaced with the released package version by `prepublish.js`.
3
3
  * Builds that are not published (local, dev) report it as is.
4
4
  */
5
- const UI_KIT_VERSION = '2.1.1-staging.1';
5
+ const UI_KIT_VERSION = '2.2.0-staging.1';
6
6
  /**
7
7
  * The wrapper packages load components from the loader bundle, which carries its own copy of
8
8
  * this module, separate from the copy behind the main entry. The registered symbol is the one
@@ -1 +1 @@
1
- import{j as t,k as n,l as o,m as r,n as e,o as i,p as s,q as a,r as c,s as f,t as u,v as d,w as l,x as v,y as m,z as p,A as b,S as g}from"./p-D4GSX-co.js";import{i as y,a as k,b as F}from"./p-Dkd2PDJ-.js";var $=[0,.5,1,1.5,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96];const x={darkest:{background:{1e3:"#080808",900:"#1A1A1A",800:"#1E1E1E",700:"#2C2C2C",600:"#393939"},text:"#FFFFFF"},dark:{background:{1e3:"#252525",900:"#2F2F2F",800:"#323232",700:"#3E3E3E",600:"#4A4A4A"},text:"#F5F5F5","video-bg":"#1C1C1C"},light:{background:{1e3:"#FFFFFF",900:"#F5F5F5",800:"#EBEBEB",700:"#E0E0E0",600:"#D6D6D6"},text:"#111111","text-on-brand":"#ffffff","video-bg":"#DADADA"}},h={none:{none:0,sm:0,md:0,lg:0},thin:{none:0,sm:1,md:2,lg:4},fat:{none:0,sm:2,md:4,lg:8}},j={sharp:{none:0,sm:0,md:0,lg:0},rounded:{none:0,sm:4,md:8,lg:12},"extra-rounded":{none:0,sm:8,md:16,lg:24},circular:{none:9999,sm:9999,md:9999,lg:9999}};function E(t){let n="0",o="0",r="0";return 4==(t=t.trim()).length?(n="0x"+t[1]+t[1],o="0x"+t[2]+t[2],r="0x"+t[3]+t[3]):t.length>6&&(n="0x"+t[1]+t[2],o="0x"+t[3]+t[4],r="0x"+t[5]+t[6]),[+n,+o,+r]}const A=t=>"string"==typeof t&&7===t.length&&t.startsWith("#"),O="--rtk-";function D(t,n=O){return n+t}const w=(t,n,o=O)=>{Object.keys(n).forEach((r=>{const e=n[r];if("string"==typeof e)if("text"===r||"text-on-brand"===r){const n=E(e).join(" ");t.style.setProperty(D(`colors-${r}-1000`,o),`${n}`),t.style.setProperty(D(`colors-${r}-900`,o),`${n} / 0.88`),t.style.setProperty(D(`colors-${r}-800`,o),`${n} / 0.76`),t.style.setProperty(D(`colors-${r}-700`,o),`${n} / 0.64`),t.style.setProperty(D(`colors-${r}-600`,o),`${n} / 0.52`)}else{const n=E(e).join(" ");t.style.setProperty(D(`colors-${r}`,o),n)}else"object"==typeof e&&Object.keys(e).forEach((n=>{const i=E(e[n]).join(" ");t.style.setProperty(D(`colors-${r}-${n}`,o),i)}))}))},C=(t,{spacingBase:n,borderRadius:o,borderWidth:r,colors:e,fontFamily:i,googleFont:s,theme:a,tokenPrefix:c=O})=>{if("object"!=typeof t)throw new Error("[rtk-ui-kit] (provideRtkDesignSystem): Passed element is not a valid HTML Element");if("string"==typeof s&&((t=>{const n=[];if(null==document.querySelector("link[data-rtk-font]")){const t=document.createElement("link");t.rel="preconnect",t.setAttribute("data-rtk-font","true"),t.href="https://fonts.googleapis.com";const o=t.cloneNode(!0);o.href="https://fonts.gstatic.com",o.crossOrigin="",n.push(t,o)}const o=document.createElement("link");o.rel="stylesheet",o.setAttribute("data-rtk-font",t),o.href=encodeURI(`https://fonts.googleapis.com/css2?family=${t}:wght@${[400,500,700].join(";")}&display=swap`),n.push(o),document.head.append(...n)})(s),t.style.setProperty(D("font-family",c),s)),"string"==typeof i&&t.style.setProperty(D("font-family",c),i),"number"==typeof n&&((t,n,o=O)=>{$.forEach((r=>{t.style.setProperty(D(`space-${r}`,o),r*n+"px")}))})(t,n,c),"string"==typeof r&&((t,n,o=O)=>{if(n in h){const r=h[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-width-${n}`,o),`${r[n]}px`)}))}})(t,r,c),"string"==typeof o&&((t,n,o=O)=>{if(n in j){const r=j[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-radius-${n}`,o),`${r[n]}px`)}))}})(t,o,c),"string"==typeof a){const n=x[a];null!=n&&w(t,n,c)}"object"==typeof e&&w(t,e,c)};function _(t){return t}var S,R,B,I=Date.now,P=t?function(n,o){return t(n,"toString",{configurable:!0,enumerable:!1,value:(r=o,function(){return r}),writable:!0});var r}:_,L=(S=P,R=0,B=0,function(){var t=I(),n=16-(t-B);if(B=t,n>0){if(++R>=800)return arguments[0]}else R=0;return S.apply(void 0,arguments)}),N=Math.max;var T=Object.prototype.hasOwnProperty;function H(t){return r(t)?a(t,!0):function(t){if(!y(t))return function(t){var n=[];if(null!=t)for(var o in Object(t))n.push(o);return n}(t);var n=s(t),o=[];for(var r in t)("constructor"!=r||!n&&T.call(t,r))&&o.push(r);return o}(t)}var M=Function.prototype.toString,U=Object.prototype.hasOwnProperty,V=M.call(Object);function q(t,o,r){(void 0!==r&&!i(t[o],r)||void 0===r&&!(o in t))&&n(t,o,r)}function z(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}function G(t,e,i,s,a,g,$){var x=z(t,i),h=z(e,i),j=$.get(h);if(j)q(t,i,j);else{var E,A=g?g(x,h,i+"",t,e,$):void 0,O=void 0===A;if(O){var D=d(h),w=!D&&f(h),C=!D&&!w&&u(h);A=h,D||w||C?d(x)?A=x:k(E=x)&&r(E)?A=function(t,n){var o=-1,r=t.length;for(n||(n=Array(r));++o<r;)n[o]=t[o];return n}(x):w?(O=!1,A=l(h,!0)):C?(O=!1,A=v(h,!0)):A=[]:function(t){if(!k(t)||"[object Object]"!=F(t))return!1;var n=c(t);if(null===n)return!0;var o=U.call(n,"constructor")&&n.constructor;return"function"==typeof o&&o instanceof o&&M.call(o)==V}(h)||m(h)?(A=x,m(x)?A=function(t){return function(t,r,e){var i=!e;e||(e={});for(var s=-1,a=r.length;++s<a;){var c=r[s],f=void 0;void 0===f&&(f=t[c]),i?n(e,c,f):o(e,c,f)}return e}(t,H(t))}(x):y(x)&&!p(x)||(A=b(h))):O=!1}O&&($.set(h,A),a(A,h,s,g,$),$.delete(h)),q(t,i,A)}}function J(t,n,o,r,e){t!==n&&function(t,n,o){for(var r=-1,e=Object(t),i=o(t),s=i.length;s--;){var a=i[++r];if(!1===n(e[a],a,e))break}}(n,(function(i,s){if(e||(e=new g),y(i))G(t,n,s,o,J,r,e);else{var a=r?r(z(t,s),i,s+"",t,n,e):void 0;void 0===a&&(a=i),q(t,s,a)}}),H)}var K,W=(K=function(t,n,o){J(t,n,o)},function(t,n){return L(function(t,n,o){return n=N(void 0===n?t.length-1:n,0),function(){for(var r=arguments,e=-1,i=N(r.length-n,0),s=Array(i);++e<i;)s[e]=r[n+e];e=-1;for(var a=Array(n+1);++e<n;)a[e]=r[e];return a[n]=o(s),function(t,n,o){switch(o.length){case 0:return t.call(n);case 1:return t.call(n,o[0]);case 2:return t.call(n,o[0],o[1]);case 3:return t.call(n,o[0],o[1],o[2])}return t.apply(n,o)}(t,this,a)}}(t,n,_),t+"")}((function(t,n){var o=-1,s=n.length,a=s>1?n[s-1]:void 0,c=s>2?n[2]:void 0;for(a=K.length>3&&"function"==typeof a?(s--,a):void 0,c&&function(t,n,o){if(!y(o))return!1;var s=typeof n;return!!("number"==s?r(o)&&e(n,o.length):"string"==s&&n in o)&&i(o[n],t)}(n[0],n[1],c)&&(a=s<3?void 0:a,s=1),t=Object(t);++o<s;){var f=n[o];f&&K(t,f,o)}return t})));const X=Symbol.for("rtk.uikit.sdkName"),Q=globalThis;function Y(t){Q[X]=t}function Z(){var t;return null!==(t=Q[X])&&void 0!==t?t:"html"}function tt(t){var n,o;try{null===(o=null===(n=null==t?void 0:t.__internals__)||void 0===n?void 0:n.setUiKitMetadata)||void 0===o||o.call(n,{sdkVersion:"2.1.1-staging.1",sdkName:Z()})}catch(t){}}export{A as i,W as m,C as p,tt as r,Y as s}
1
+ import{j as t,k as n,l as o,m as r,n as e,o as i,p as s,q as a,r as c,s as f,t as u,v as d,w as l,x as v,y as m,z as p,A as b,S as g}from"./p-D4GSX-co.js";import{i as y,a as k,b as F}from"./p-Dkd2PDJ-.js";var $=[0,.5,1,1.5,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96];const x={darkest:{background:{1e3:"#080808",900:"#1A1A1A",800:"#1E1E1E",700:"#2C2C2C",600:"#393939"},text:"#FFFFFF"},dark:{background:{1e3:"#252525",900:"#2F2F2F",800:"#323232",700:"#3E3E3E",600:"#4A4A4A"},text:"#F5F5F5","video-bg":"#1C1C1C"},light:{background:{1e3:"#FFFFFF",900:"#F5F5F5",800:"#EBEBEB",700:"#E0E0E0",600:"#D6D6D6"},text:"#111111","text-on-brand":"#ffffff","video-bg":"#DADADA"}},h={none:{none:0,sm:0,md:0,lg:0},thin:{none:0,sm:1,md:2,lg:4},fat:{none:0,sm:2,md:4,lg:8}},j={sharp:{none:0,sm:0,md:0,lg:0},rounded:{none:0,sm:4,md:8,lg:12},"extra-rounded":{none:0,sm:8,md:16,lg:24},circular:{none:9999,sm:9999,md:9999,lg:9999}};function E(t){let n="0",o="0",r="0";return 4==(t=t.trim()).length?(n="0x"+t[1]+t[1],o="0x"+t[2]+t[2],r="0x"+t[3]+t[3]):t.length>6&&(n="0x"+t[1]+t[2],o="0x"+t[3]+t[4],r="0x"+t[5]+t[6]),[+n,+o,+r]}const A=t=>"string"==typeof t&&7===t.length&&t.startsWith("#"),O="--rtk-";function D(t,n=O){return n+t}const w=(t,n,o=O)=>{Object.keys(n).forEach((r=>{const e=n[r];if("string"==typeof e)if("text"===r||"text-on-brand"===r){const n=E(e).join(" ");t.style.setProperty(D(`colors-${r}-1000`,o),`${n}`),t.style.setProperty(D(`colors-${r}-900`,o),`${n} / 0.88`),t.style.setProperty(D(`colors-${r}-800`,o),`${n} / 0.76`),t.style.setProperty(D(`colors-${r}-700`,o),`${n} / 0.64`),t.style.setProperty(D(`colors-${r}-600`,o),`${n} / 0.52`)}else{const n=E(e).join(" ");t.style.setProperty(D(`colors-${r}`,o),n)}else"object"==typeof e&&Object.keys(e).forEach((n=>{const i=E(e[n]).join(" ");t.style.setProperty(D(`colors-${r}-${n}`,o),i)}))}))},C=(t,{spacingBase:n,borderRadius:o,borderWidth:r,colors:e,fontFamily:i,googleFont:s,theme:a,tokenPrefix:c=O})=>{if("object"!=typeof t)throw new Error("[rtk-ui-kit] (provideRtkDesignSystem): Passed element is not a valid HTML Element");if("string"==typeof s&&((t=>{const n=[];if(null==document.querySelector("link[data-rtk-font]")){const t=document.createElement("link");t.rel="preconnect",t.setAttribute("data-rtk-font","true"),t.href="https://fonts.googleapis.com";const o=t.cloneNode(!0);o.href="https://fonts.gstatic.com",o.crossOrigin="",n.push(t,o)}const o=document.createElement("link");o.rel="stylesheet",o.setAttribute("data-rtk-font",t),o.href=encodeURI(`https://fonts.googleapis.com/css2?family=${t}:wght@${[400,500,700].join(";")}&display=swap`),n.push(o),document.head.append(...n)})(s),t.style.setProperty(D("font-family",c),s)),"string"==typeof i&&t.style.setProperty(D("font-family",c),i),"number"==typeof n&&((t,n,o=O)=>{$.forEach((r=>{t.style.setProperty(D(`space-${r}`,o),r*n+"px")}))})(t,n,c),"string"==typeof r&&((t,n,o=O)=>{if(n in h){const r=h[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-width-${n}`,o),`${r[n]}px`)}))}})(t,r,c),"string"==typeof o&&((t,n,o=O)=>{if(n in j){const r=j[n];Object.keys(r).forEach((n=>{t.style.setProperty(D(`border-radius-${n}`,o),`${r[n]}px`)}))}})(t,o,c),"string"==typeof a){const n=x[a];null!=n&&w(t,n,c)}"object"==typeof e&&w(t,e,c)};function _(t){return t}var S,R,B,I=Date.now,P=t?function(n,o){return t(n,"toString",{configurable:!0,enumerable:!1,value:(r=o,function(){return r}),writable:!0});var r}:_,L=(S=P,R=0,B=0,function(){var t=I(),n=16-(t-B);if(B=t,n>0){if(++R>=800)return arguments[0]}else R=0;return S.apply(void 0,arguments)}),N=Math.max;var T=Object.prototype.hasOwnProperty;function H(t){return r(t)?a(t,!0):function(t){if(!y(t))return function(t){var n=[];if(null!=t)for(var o in Object(t))n.push(o);return n}(t);var n=s(t),o=[];for(var r in t)("constructor"!=r||!n&&T.call(t,r))&&o.push(r);return o}(t)}var M=Function.prototype.toString,U=Object.prototype.hasOwnProperty,V=M.call(Object);function q(t,o,r){(void 0!==r&&!i(t[o],r)||void 0===r&&!(o in t))&&n(t,o,r)}function z(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}function G(t,e,i,s,a,g,$){var x=z(t,i),h=z(e,i),j=$.get(h);if(j)q(t,i,j);else{var E,A=g?g(x,h,i+"",t,e,$):void 0,O=void 0===A;if(O){var D=d(h),w=!D&&f(h),C=!D&&!w&&u(h);A=h,D||w||C?d(x)?A=x:k(E=x)&&r(E)?A=function(t,n){var o=-1,r=t.length;for(n||(n=Array(r));++o<r;)n[o]=t[o];return n}(x):w?(O=!1,A=l(h,!0)):C?(O=!1,A=v(h,!0)):A=[]:function(t){if(!k(t)||"[object Object]"!=F(t))return!1;var n=c(t);if(null===n)return!0;var o=U.call(n,"constructor")&&n.constructor;return"function"==typeof o&&o instanceof o&&M.call(o)==V}(h)||m(h)?(A=x,m(x)?A=function(t){return function(t,r,e){var i=!e;e||(e={});for(var s=-1,a=r.length;++s<a;){var c=r[s],f=void 0;void 0===f&&(f=t[c]),i?n(e,c,f):o(e,c,f)}return e}(t,H(t))}(x):y(x)&&!p(x)||(A=b(h))):O=!1}O&&($.set(h,A),a(A,h,s,g,$),$.delete(h)),q(t,i,A)}}function J(t,n,o,r,e){t!==n&&function(t,n,o){for(var r=-1,e=Object(t),i=o(t),s=i.length;s--;){var a=i[++r];if(!1===n(e[a],a,e))break}}(n,(function(i,s){if(e||(e=new g),y(i))G(t,n,s,o,J,r,e);else{var a=r?r(z(t,s),i,s+"",t,n,e):void 0;void 0===a&&(a=i),q(t,s,a)}}),H)}var K,W=(K=function(t,n,o){J(t,n,o)},function(t,n){return L(function(t,n,o){return n=N(void 0===n?t.length-1:n,0),function(){for(var r=arguments,e=-1,i=N(r.length-n,0),s=Array(i);++e<i;)s[e]=r[n+e];e=-1;for(var a=Array(n+1);++e<n;)a[e]=r[e];return a[n]=o(s),function(t,n,o){switch(o.length){case 0:return t.call(n);case 1:return t.call(n,o[0]);case 2:return t.call(n,o[0],o[1]);case 3:return t.call(n,o[0],o[1],o[2])}return t.apply(n,o)}(t,this,a)}}(t,n,_),t+"")}((function(t,n){var o=-1,s=n.length,a=s>1?n[s-1]:void 0,c=s>2?n[2]:void 0;for(a=K.length>3&&"function"==typeof a?(s--,a):void 0,c&&function(t,n,o){if(!y(o))return!1;var s=typeof n;return!!("number"==s?r(o)&&e(n,o.length):"string"==s&&n in o)&&i(o[n],t)}(n[0],n[1],c)&&(a=s<3?void 0:a,s=1),t=Object(t);++o<s;){var f=n[o];f&&K(t,f,o)}return t})));const X=Symbol.for("rtk.uikit.sdkName"),Q=globalThis;function Y(t){Q[X]=t}function Z(){var t;return null!==(t=Q[X])&&void 0!==t?t:"html"}function tt(t){var n,o;try{null===(o=null===(n=null==t?void 0:t.__internals__)||void 0===n?void 0:n.setUiKitMetadata)||void 0===o||o.call(n,{sdkVersion:"2.2.0-staging.1",sdkName:Z()})}catch(t){}}export{A as i,W as m,C as p,tt as r,Y as s}
@@ -1 +1 @@
1
- import{p as t,H as e,c as a,w as i,h as r,d as s,t as o}from"./p-BBHQOrFK.js";import{e as n,i as c}from"./p-D4GSX-co.js";import{i as d,r as l,e as p,a as h}from"./p-GSFejkz7.js";import{S as f}from"./p-C8uVSyiQ.js";import{d as k}from"./p-D6vw6bT2.js";import{d as g}from"./p-BYIBbfJ8.js";import{d as b}from"./p-DHSRRtn3.js";var v=function(t,e,a,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,a,i);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s<3?r(o):s>3?r(e,a,o):r(e,a))||o);return s>3&&o&&Object.defineProperty(e,a,o),o};const m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.stateUpdate=a(this,"rtkStateUpdate",7),this.play=a(this,"screensharePlay",7),this.fullScreenListener=()=>{this.isFullScreen=d()},this.participantScreenshareUpdate=t=>{t.id===this.participant.id&&this.screenShareListener(t)},this.hideFullScreenButton=!1,this.nameTagPosition="bottom-left",this.variant="solid",this.iconPack=n,this.t=c(),this.videoExpanded=!1,this.screenShareEnabled=!1,this.isSwitchingScreen=!1,this.isFullScreen=!1,this.shareDifferentScreen=async()=>{const t=this.meeting;if(null!=t&&!this.isSwitchingScreen){this.isSwitchingScreen=!0;try{await t.self.enableScreenShare()}catch(e){t.__internals__.logger.error("rtkScreenshareView::shareDifferentScreen",{error:e})}finally{this.isSwitchingScreen=!1}}},this.toggleFullScreen=()=>{this.isFullScreen?(p(),this.isFullScreen=!1):(l(this.host),this.isFullScreen=!0)}}connectedCallback(){null===window||void 0===window||window.addEventListener("fullscreenchange",this.fullScreenListener),null===window||void 0===window||window.addEventListener("webkitfullscreenchange",this.fullScreenListener)}componentDidLoad(){this.participantChanged(this.participant)}disconnectedCallback(){if(!this.meeting)return;const{self:t}=this.meeting;this.participant.id===t.id&&this.screenShareListener?this.participant.removeListener("screenShareUpdate",this.screenShareListener):this.meeting.participants.joined.removeListener("screenShareUpdate",this.participantScreenshareUpdate),null===window||void 0===window||window.removeEventListener("fullscreenchange",this.fullScreenListener),null===window||void 0===window||window.removeEventListener("webkitfullscreenchange",this.fullScreenListener)}participantChanged(t){if(null!=t&&this.meeting){const{self:e}=this.meeting;this.screenShareListener=({screenShareEnabled:t,screenShareTracks:e})=>{const a=t&&null!=e.video;if(i((()=>{this.screenShareEnabled=a})),a){const t=new MediaStream;t.addTrack(e.video),null!=this.videoEl&&(this.videoEl.srcObject=t,this.videoEl.play())}else null!=this.videoEl&&(this.videoEl.srcObject=void 0)},this.screenShareListener(t),t.id===e.id?t.addListener("screenShareUpdate",this.screenShareListener):this.meeting.participants.joined.addListener("screenShareUpdate",this.participantScreenshareUpdate)}}render(){var t,e,a;const i=(null===(t=this.participant)||void 0===t?void 0:t.id)===(null===(e=this.meeting)||void 0===e?void 0:e.self.id),o=this.t(this.isFullScreen?"full_screen.exit":"full_screen"),n=this.isFullScreen?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize;return r(s,{key:"0de66f829d0426af746b72561e7470c50c703060",class:{isSelf:i}},r("div",{key:"video-container",id:"video-container",class:{expand:this.videoExpanded}},r("video",{key:"2e56da582533ee6a8286483fa4495ff9a88453a0",ref:t=>this.videoEl=t,class:{visible:this.screenShareEnabled,"fit-in-container":this.participant.supportsRemoteControl},playsInline:!0,onPlay:()=>{this.play.emit({screenshareParticipant:this.participant,participant:this.meeting.self})},autoPlay:!0,muted:!0,id:"screen-share-video-"+this.participant.id})),r("div",{id:"controls",key:"controls"},!this.hideFullScreenButton&&!i&&h()&&r("rtk-tooltip",{key:"7cd30b509e71685bb28615fd0eeb289764bc6f4b",label:o},r("rtk-button",{key:"0610dd55ad5a29cdbb77c61ed024253a70c66020",id:"full-screen-btn",kind:"icon",onClick:this.toggleFullScreen,title:o},r("rtk-icon",{key:"1ea3a04938cb5836afcf171fa881916f1a63da79",icon:n,"aria-hidden":!0,tabIndex:-1})))),i&&r("div",{id:"self-message",key:"self-message"},r("h3",{key:"4758cad86ab2453cbfbf9276e9db8f4f45889e4a"},this.t("screenshare.shared")),r("div",{key:"136f80c0f74bbc9d860dfc9a5f2f04531dc9fe80",class:"actions"},null!=this.meeting&&r("rtk-button",{key:"2588174e0054805565c0ae9d3d7001d812c25d6c",variant:"danger",onClick:()=>{this.meeting.self.disableScreenShare()}},r("rtk-icon",{key:"10de1c2c538cc069d5ea9c4a8e89699cdb06e970",icon:this.iconPack.share_screen_stop,slot:"start"}),this.t("screenshare.stop")),null!=this.meeting&&r("rtk-button",{key:"916802524a950adadd39eac97660d05034840a8b",variant:"secondary",disabled:this.isSwitchingScreen,onClick:this.shareDifferentScreen},r("rtk-icon",{key:"5142a5fe580a7c900d7435e5c638bef0533a289b",icon:null!==(a=this.iconPack.share_screen_different)&&void 0!==a?a:this.iconPack.share_screen_start,slot:"start"}),this.t("screenshare.share_different_screen")),r("rtk-button",{key:"6b024ca8b2b537b84862f96f35ab1e2a9832c974",variant:"secondary",id:"expand-btn",onClick:()=>{this.videoExpanded=!this.videoExpanded}},r("rtk-icon",{key:"aef5ba226ba681c6ec6d11f0ac78c03329a88f27",icon:this.videoExpanded?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize,slot:"start"}),this.t(this.videoExpanded?"screenshare.min_preview":"screenshare.max_preview")))),r("slot",{key:"f21ad85d1847864f268d1fa33235467f14de2420"}))}get host(){return this}static get watchers(){return{participant:[{participantChanged:0}]}}static get style(){return":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{height:100%;width:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--rtk-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));container-type:inline-size;container-name:screentile}::slotted(rtk-name-tag){position:absolute;left:var(--rtk-space-3, 12px);bottom:var(--rtk-space-3, 12px);opacity:0.8}#video-container{position:absolute;display:block;height:100%;width:100%}#video-container .fit-in-container{-o-object-fit:fill;object-fit:fill}video{height:100%;width:100%;-o-object-fit:contain;object-fit:contain}:host([variant='gradient']) ::slotted(rtk-audio-visualizer){position:absolute;top:var(--rtk-space-2, 8px);right:var(--rtk-space-2, 8px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));padding:var(--rtk-space-2, 8px)}:host([variant='gradient']) ::slotted(rtk-name-tag){bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);display:flex;width:100%;align-items:center;justify-content:center;text-align:center;background-color:transparent;background-image:linear-gradient(to top, var(--tw-gradient-stops));--tw-gradient-from:rgb(var(--rtk-colors-background-1000, 8 8 8));--tw-gradient-to:rgba(var(--rtk-colors-background-1000, 8 8 8) / 0);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to:transparent}:host([size='sm'][variant='gradient']) ::slotted(rtk-audio-visualizer){height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}video.visible{animation:video-fadein 0.4s ease}#controls{display:none;position:absolute;top:var(--rtk-space-3, 12px);right:var(--rtk-space-3, 12px);align-items:center;justify-content:flex-end;gap:var(--rtk-space-2, 8px)}:host(:hover) #controls,:host(:active) #controls,:host(:focus-visible) #controls{display:flex}#full-screen-btn{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}h3{margin-top:var(--rtk-space-10, 40px);margin-bottom:var(--rtk-space-6, 24px);text-align:center;font-size:20px;font-weight:500}:host([size='sm']) h3{font-size:16px}#self-message{padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}:host(.isSelf) #self-view{flex:1 1 0%}:host(.isSelf) #video-container{position:static;aspect-ratio:auto;height:auto;width:50%;max-width:var(--rtk-space-96, 384px);border-radius:var(--rtk-border-radius-md, 8px);transition:0.6s ease}:host(.isSelf) #video-container.expand{width:60%;max-width:100%}.actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--rtk-space-2, 8px)}:host([size='sm'].isSelf) #video-container,:host([size='md'].isSelf) #video-container,:host([size='sm'].isSelf) #expand-btn,:host([size='md'].isSelf) #expand-btn{display:none}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.remote-control{z-index:10;height:100%;max-height:100%;flex:0 1 auto}#remote-control-self{position:absolute;top:var(--rtk-space-0, 0px);left:50%;z-index:10;width:-moz-max-content;width:max-content;max-width:100%;box-sizing:border-box;display:flex;height:var(--rtk-space-8, 32px);align-items:center;overflow:hidden;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-bg-opacity));font-size:12px;color:rgb(var(--rtk-colors-text-1000, 255 255 255));transform:translateX(-50%)}#remote-control-self p{padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px)}#remote-control-self rtk-button{height:100%;border-radius:var(--rtk-border-radius-none, 0);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-bg-opacity));font-size:12px}:host([size='sm']) #remote-control-self{height:auto;flex-direction:column}:host([size='sm']) #remote-control-self rtk-button{width:100%;padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px)}:host([name-tag-position='bottom-right']) ::slotted(rtk-name-tag){left:auto;right:var(--rtk-space-3, 12px)}:host([name-tag-position='bottom-center']) ::slotted(rtk-name-tag){left:auto;right:auto}:host([name-tag-position='top-left']) ::slotted(rtk-name-tag){top:var(--rtk-space-3, 12px);bottom:auto}:host([name-tag-position='top-right']) ::slotted(rtk-name-tag){top:var(--rtk-space-3, 12px);right:var(--rtk-space-3, 12px);left:auto;bottom:auto}:host([name-tag-position='top-center']) ::slotted(rtk-name-tag){left:auto;right:auto;bottom:auto;top:var(--rtk-space-3, 12px)}@keyframes video-fadein{0%{opacity:0;transform:scale(1.4) translateY(20px)}100%{opacity:1;transform:scale(1) translateY(0)}}::slotted(rtk-network-indicator){position:absolute;right:var(--rtk-space-3, 12px);bottom:var(--rtk-space-3, 12px)}@media only screen and (max-height: 480px) and (orientation: landscape){:host([size='sm'][variant='solid']) ::slotted(rtk-name-tag),:host([size='sm'][variant='solid']) rtk-name-tag{left:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);border-radius:var(--rtk-border-radius-none, 0);transform-origin:0% 110%;transform:scale(0.6)}}@container screentile (max-width: 400px){::slotted(rtk-name-tag){transform-origin:0 130%;transform:scale(0.7)}}"}},[257,"rtk-screenshare-view",{hideFullScreenButton:[4,"hide-full-screen-button"],nameTagPosition:[513,"name-tag-position"],participant:[16],meeting:[16],variant:[513],size:[513],iconPack:[16],t:[16],videoExpanded:[32],screenShareEnabled:[32],isSwitchingScreen:[32],isFullScreen:[32],remoteControlInfo:[32]},void 0,{participant:[{participantChanged:0}]}]);function u(){"undefined"!=typeof customElements&&["rtk-screenshare-view","rtk-button","rtk-icon","rtk-tooltip"].forEach((t=>{switch(t){case"rtk-screenshare-view":customElements.get(o(t))||customElements.define(o(t),m);break;case"rtk-button":customElements.get(o(t))||k();break;case"rtk-icon":customElements.get(o(t))||g();break;case"rtk-tooltip":customElements.get(o(t))||b()}}))}v([f()],m.prototype,"meeting",void 0),v([f()],m.prototype,"iconPack",void 0),v([f()],m.prototype,"t",void 0),u();const x=m,w=u;export{x as RtkScreenshareView,w as defineCustomElement}
1
+ import{p as t,H as e,c as a,w as i,h as r,d as s,t as o}from"./p-BBHQOrFK.js";import{e as n,i as c}from"./p-D4GSX-co.js";import{i as d,r as l,e as p,a as h}from"./p-GSFejkz7.js";import{S as b}from"./p-C8uVSyiQ.js";import{d as f}from"./p-D6vw6bT2.js";import{d as k}from"./p-BYIBbfJ8.js";import{d as g}from"./p-DHSRRtn3.js";var v=function(t,e,a,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,a,i);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s<3?r(o):s>3?r(e,a,o):r(e,a))||o);return s>3&&o&&Object.defineProperty(e,a,o),o};const m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.stateUpdate=a(this,"rtkStateUpdate",7),this.play=a(this,"screensharePlay",7),this.screenShareListener=({screenShareEnabled:t,screenShareTracks:e})=>{const a=t&&null!=e.video;i((()=>{this.screenShareEnabled=a}))},this.onVideoRef=t=>{var e;null!=t&&t!==this.videoEl&&(this.videoEl=t,null===(e=this.participant)||void 0===e||e.registerScreenshareVideoElement(t))},this.fullScreenListener=()=>{this.isFullScreen=d()},this.participantScreenshareUpdate=t=>{t.id===this.participant.id&&this.screenShareListener(t)},this.hideFullScreenButton=!1,this.nameTagPosition="bottom-left",this.variant="solid",this.iconPack=n,this.t=c(),this.videoExpanded=!1,this.screenShareEnabled=!1,this.isSwitchingScreen=!1,this.isFullScreen=!1,this.shareDifferentScreen=async()=>{const t=this.meeting;if(null!=t&&!this.isSwitchingScreen){this.isSwitchingScreen=!0;try{await t.self.enableScreenShare()}catch(e){t.__internals__.logger.error("rtkScreenshareView::shareDifferentScreen",{error:e})}finally{this.isSwitchingScreen=!1}}},this.toggleFullScreen=()=>{this.isFullScreen?(p(),this.isFullScreen=!1):(l(this.host),this.isFullScreen=!0)}}connectedCallback(){null===window||void 0===window||window.addEventListener("fullscreenchange",this.fullScreenListener),null===window||void 0===window||window.addEventListener("webkitfullscreenchange",this.fullScreenListener),this.participantChanged(this.participant)}disconnectedCallback(){this.cleanupParticipant(this.participant),null===window||void 0===window||window.removeEventListener("fullscreenchange",this.fullScreenListener),null===window||void 0===window||window.removeEventListener("webkitfullscreenchange",this.fullScreenListener)}participantChanged(t,e){this.cleanupParticipant(e),null!=t&&(this.videoEl&&t.registerScreenshareVideoElement(this.videoEl),this.meeting&&(this.screenShareListener(t),t.id===this.meeting.self.id?t.addListener("screenShareUpdate",this.screenShareListener):this.meeting.participants.joined.addListener("screenShareUpdate",this.participantScreenshareUpdate)))}cleanupParticipant(t){null!=t&&(this.videoEl&&t.deregisterScreenshareVideoElement(this.videoEl),this.meeting&&(t.id===this.meeting.self.id?t.removeListener("screenShareUpdate",this.screenShareListener):this.meeting.participants.joined.removeListener("screenShareUpdate",this.participantScreenshareUpdate)))}render(){var t,e,a;const i=(null===(t=this.participant)||void 0===t?void 0:t.id)===(null===(e=this.meeting)||void 0===e?void 0:e.self.id),o=this.t(this.isFullScreen?"full_screen.exit":"full_screen"),n=this.isFullScreen?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize;return r(s,{key:"194efb9fa8783a441c8050ebab07a2d3546446bf",class:{isSelf:i}},r("div",{key:"video-container",id:"video-container",class:{expand:this.videoExpanded}},r("video",{key:"de008c1a856ba19e766c03b71b1be492a9975261",ref:this.onVideoRef,class:{visible:this.screenShareEnabled,"fit-in-container":this.participant.supportsRemoteControl},playsInline:!0,onPlay:()=>{this.play.emit({screenshareParticipant:this.participant,participant:this.meeting.self})},autoPlay:!0,muted:!0,id:"screen-share-video-"+this.participant.id})),r("div",{id:"controls",key:"controls"},!this.hideFullScreenButton&&!i&&h()&&r("rtk-tooltip",{key:"bf9a96bcba99bb9cf13bbcf572e5a9b71d53498b",label:o},r("rtk-button",{key:"06a5eb9396056114d9e1a339454e782b9c533a9b",id:"full-screen-btn",kind:"icon",onClick:this.toggleFullScreen,title:o},r("rtk-icon",{key:"fa4e499769a910ceb9b2bffa6668db83adbad135",icon:n,"aria-hidden":!0,tabIndex:-1})))),i&&r("div",{id:"self-message",key:"self-message"},r("h3",{key:"1650592e64dd44004a53ccc168ab7138c78ea7f4"},this.t("screenshare.shared")),r("div",{key:"d09216ab62012e1d2d445b8f080ae18786fc197e",class:"actions"},null!=this.meeting&&r("rtk-button",{key:"f4e8c65eaaf40190eb566eb473d7932411731793",variant:"danger",onClick:()=>{this.meeting.self.disableScreenShare()}},r("rtk-icon",{key:"215fd1e658442e6f9c70ee5f7cabcd22e0901886",icon:this.iconPack.share_screen_stop,slot:"start"}),this.t("screenshare.stop")),null!=this.meeting&&r("rtk-button",{key:"a73b3774901661020ef20e9e48dc81a4277cc471",variant:"secondary",disabled:this.isSwitchingScreen,onClick:this.shareDifferentScreen},r("rtk-icon",{key:"f9a4304e8cb648f5f2ca6ee650f6b512e86f1833",icon:null!==(a=this.iconPack.share_screen_different)&&void 0!==a?a:this.iconPack.share_screen_start,slot:"start"}),this.t("screenshare.share_different_screen")),r("rtk-button",{key:"b2f93bd50018b9a727860014d0d4c33ab8a23334",variant:"secondary",id:"expand-btn",onClick:()=>{this.videoExpanded=!this.videoExpanded}},r("rtk-icon",{key:"40d5bb9a3dfc648035b946ced0c584b3a6312100",icon:this.videoExpanded?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize,slot:"start"}),this.t(this.videoExpanded?"screenshare.min_preview":"screenshare.max_preview")))),r("slot",{key:"a2908fef4320f0bf4408a6a07d2ba4bea0acdc4c"}))}get host(){return this}static get watchers(){return{participant:[{participantChanged:0}]}}static get style(){return":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{height:100%;width:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--rtk-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));container-type:inline-size;container-name:screentile}::slotted(rtk-name-tag){position:absolute;left:var(--rtk-space-3, 12px);bottom:var(--rtk-space-3, 12px);opacity:0.8}#video-container{position:absolute;display:block;height:100%;width:100%}#video-container .fit-in-container{-o-object-fit:fill;object-fit:fill}video{height:100%;width:100%;-o-object-fit:contain;object-fit:contain}:host([variant='gradient']) ::slotted(rtk-audio-visualizer){position:absolute;top:var(--rtk-space-2, 8px);right:var(--rtk-space-2, 8px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));padding:var(--rtk-space-2, 8px)}:host([variant='gradient']) ::slotted(rtk-name-tag){bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);display:flex;width:100%;align-items:center;justify-content:center;text-align:center;background-color:transparent;background-image:linear-gradient(to top, var(--tw-gradient-stops));--tw-gradient-from:rgb(var(--rtk-colors-background-1000, 8 8 8));--tw-gradient-to:rgba(var(--rtk-colors-background-1000, 8 8 8) / 0);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to:transparent}:host([size='sm'][variant='gradient']) ::slotted(rtk-audio-visualizer){height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}video.visible{animation:video-fadein 0.4s ease}#controls{display:none;position:absolute;top:var(--rtk-space-3, 12px);right:var(--rtk-space-3, 12px);align-items:center;justify-content:flex-end;gap:var(--rtk-space-2, 8px)}:host(:hover) #controls,:host(:active) #controls,:host(:focus-visible) #controls{display:flex}#full-screen-btn{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}h3{margin-top:var(--rtk-space-10, 40px);margin-bottom:var(--rtk-space-6, 24px);text-align:center;font-size:20px;font-weight:500}:host([size='sm']) h3{font-size:16px}#self-message{padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}:host(.isSelf) #self-view{flex:1 1 0%}:host(.isSelf) #video-container{position:static;aspect-ratio:auto;height:auto;width:50%;max-width:var(--rtk-space-96, 384px);border-radius:var(--rtk-border-radius-md, 8px);transition:0.6s ease}:host(.isSelf) #video-container.expand{width:60%;max-width:100%}.actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--rtk-space-2, 8px)}:host([size='sm'].isSelf) #video-container,:host([size='md'].isSelf) #video-container,:host([size='sm'].isSelf) #expand-btn,:host([size='md'].isSelf) #expand-btn{display:none}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.remote-control{z-index:10;height:100%;max-height:100%;flex:0 1 auto}#remote-control-self{position:absolute;top:var(--rtk-space-0, 0px);left:50%;z-index:10;width:-moz-max-content;width:max-content;max-width:100%;box-sizing:border-box;display:flex;height:var(--rtk-space-8, 32px);align-items:center;overflow:hidden;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-bg-opacity));font-size:12px;color:rgb(var(--rtk-colors-text-1000, 255 255 255));transform:translateX(-50%)}#remote-control-self p{padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px)}#remote-control-self rtk-button{height:100%;border-radius:var(--rtk-border-radius-none, 0);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-bg-opacity));font-size:12px}:host([size='sm']) #remote-control-self{height:auto;flex-direction:column}:host([size='sm']) #remote-control-self rtk-button{width:100%;padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px)}:host([name-tag-position='bottom-right']) ::slotted(rtk-name-tag){left:auto;right:var(--rtk-space-3, 12px)}:host([name-tag-position='bottom-center']) ::slotted(rtk-name-tag){left:auto;right:auto}:host([name-tag-position='top-left']) ::slotted(rtk-name-tag){top:var(--rtk-space-3, 12px);bottom:auto}:host([name-tag-position='top-right']) ::slotted(rtk-name-tag){top:var(--rtk-space-3, 12px);right:var(--rtk-space-3, 12px);left:auto;bottom:auto}:host([name-tag-position='top-center']) ::slotted(rtk-name-tag){left:auto;right:auto;bottom:auto;top:var(--rtk-space-3, 12px)}@keyframes video-fadein{0%{opacity:0;transform:scale(1.4) translateY(20px)}100%{opacity:1;transform:scale(1) translateY(0)}}::slotted(rtk-network-indicator){position:absolute;right:var(--rtk-space-3, 12px);bottom:var(--rtk-space-3, 12px)}@media only screen and (max-height: 480px) and (orientation: landscape){:host([size='sm'][variant='solid']) ::slotted(rtk-name-tag),:host([size='sm'][variant='solid']) rtk-name-tag{left:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);border-radius:var(--rtk-border-radius-none, 0);transform-origin:0% 110%;transform:scale(0.6)}}@container screentile (max-width: 400px){::slotted(rtk-name-tag){transform-origin:0 130%;transform:scale(0.7)}}"}},[257,"rtk-screenshare-view",{hideFullScreenButton:[4,"hide-full-screen-button"],nameTagPosition:[513,"name-tag-position"],participant:[16],meeting:[16],variant:[513],size:[513],iconPack:[16],t:[16],videoExpanded:[32],screenShareEnabled:[32],isSwitchingScreen:[32],isFullScreen:[32],remoteControlInfo:[32]},void 0,{participant:[{participantChanged:0}]}]);function u(){"undefined"!=typeof customElements&&["rtk-screenshare-view","rtk-button","rtk-icon","rtk-tooltip"].forEach((t=>{switch(t){case"rtk-screenshare-view":customElements.get(o(t))||customElements.define(o(t),m);break;case"rtk-button":customElements.get(o(t))||f();break;case"rtk-icon":customElements.get(o(t))||k();break;case"rtk-tooltip":customElements.get(o(t))||g()}}))}v([b()],m.prototype,"meeting",void 0),v([b()],m.prototype,"iconPack",void 0),v([b()],m.prototype,"t",void 0),u();const x=m,w=u;export{x as RtkScreenshareView,w as defineCustomElement}
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-11-19T05:12:27",
2
+ "timestamp": "2026-11-23T07:10:05",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.43.5",
@@ -9915,7 +9915,7 @@ var merge = createAssigner(function(object, source, srcIndex) {
9915
9915
  * The literal below is replaced with the released package version by `prepublish.js`.
9916
9916
  * Builds that are not published (local, dev) report it as is.
9917
9917
  */
9918
- const UI_KIT_VERSION = '2.1.1-staging.1';
9918
+ const UI_KIT_VERSION = '2.2.0-staging.1';
9919
9919
  /**
9920
9920
  * The wrapper packages load components from the loader bundle, which carries its own copy of
9921
9921
  * this module, separate from the copy behind the main entry. The registered symbol is the one
@@ -23680,6 +23680,19 @@ const RtkScreenshareView = class {
23680
23680
  registerInstance(this, hostRef);
23681
23681
  this.stateUpdate = createEvent(this, "rtkStateUpdate", 7);
23682
23682
  this.play = createEvent(this, "screensharePlay", 7);
23683
+ this.screenShareListener = ({ screenShareEnabled, screenShareTracks, }) => {
23684
+ const enabled = screenShareEnabled && screenShareTracks.video != null;
23685
+ writeTask(() => {
23686
+ this.screenShareEnabled = enabled;
23687
+ });
23688
+ };
23689
+ this.onVideoRef = (el) => {
23690
+ var _a;
23691
+ if (el == null || el === this.videoEl)
23692
+ return;
23693
+ this.videoEl = el;
23694
+ (_a = this.participant) === null || _a === void 0 ? void 0 : _a.registerScreenshareVideoElement(el);
23695
+ };
23683
23696
  this.fullScreenListener = () => {
23684
23697
  this.isFullScreen = isFullScreenEnabled();
23685
23698
  };
@@ -23731,47 +23744,40 @@ const RtkScreenshareView = class {
23731
23744
  connectedCallback() {
23732
23745
  window === null || window === void 0 ? void 0 : window.addEventListener('fullscreenchange', this.fullScreenListener);
23733
23746
  window === null || window === void 0 ? void 0 : window.addEventListener('webkitfullscreenchange', this.fullScreenListener);
23734
- }
23735
- componentDidLoad() {
23736
23747
  this.participantChanged(this.participant);
23737
23748
  }
23738
23749
  disconnectedCallback() {
23750
+ this.cleanupParticipant(this.participant);
23751
+ window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
23752
+ window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
23753
+ }
23754
+ participantChanged(participant, oldParticipant) {
23755
+ // The SDK ignores a video element that another participant still manages
23756
+ this.cleanupParticipant(oldParticipant);
23757
+ if (participant == null)
23758
+ return;
23759
+ // On first load the video element is registered once it renders, see onVideoRef
23760
+ if (this.videoEl)
23761
+ participant.registerScreenshareVideoElement(this.videoEl);
23739
23762
  if (!this.meeting)
23740
23763
  return;
23741
- const { self } = this.meeting;
23742
- if (this.participant.id === self.id && this.screenShareListener)
23743
- this.participant.removeListener('screenShareUpdate', this.screenShareListener);
23764
+ this.screenShareListener(participant);
23765
+ if (participant.id === this.meeting.self.id)
23766
+ participant.addListener('screenShareUpdate', this.screenShareListener);
23744
23767
  else
23745
- this.meeting.participants.joined.removeListener('screenShareUpdate', this.participantScreenshareUpdate);
23746
- window === null || window === void 0 ? void 0 : window.removeEventListener('fullscreenchange', this.fullScreenListener);
23747
- window === null || window === void 0 ? void 0 : window.removeEventListener('webkitfullscreenchange', this.fullScreenListener);
23768
+ this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
23748
23769
  }
23749
- participantChanged(participant) {
23750
- if (participant != null && this.meeting) {
23751
- const { self } = this.meeting;
23752
- this.screenShareListener = ({ screenShareEnabled, screenShareTracks }) => {
23753
- const enabled = screenShareEnabled && screenShareTracks.video != null;
23754
- writeTask(() => {
23755
- this.screenShareEnabled = enabled;
23756
- });
23757
- if (enabled) {
23758
- const stream = new MediaStream();
23759
- stream.addTrack(screenShareTracks.video);
23760
- if (this.videoEl != null) {
23761
- this.videoEl.srcObject = stream;
23762
- this.videoEl.play();
23763
- }
23764
- }
23765
- else if (this.videoEl != null) {
23766
- this.videoEl.srcObject = undefined;
23767
- }
23768
- };
23769
- this.screenShareListener(participant);
23770
- if (participant.id === self.id)
23771
- participant.addListener('screenShareUpdate', this.screenShareListener);
23772
- else
23773
- this.meeting.participants.joined.addListener('screenShareUpdate', this.participantScreenshareUpdate);
23774
- }
23770
+ cleanupParticipant(participant) {
23771
+ if (participant == null)
23772
+ return;
23773
+ if (this.videoEl)
23774
+ participant.deregisterScreenshareVideoElement(this.videoEl);
23775
+ if (!this.meeting)
23776
+ return;
23777
+ if (participant.id === this.meeting.self.id)
23778
+ participant.removeListener('screenShareUpdate', this.screenShareListener);
23779
+ else
23780
+ this.meeting.participants.joined.removeListener('screenShareUpdate', this.participantScreenshareUpdate);
23775
23781
  }
23776
23782
  render() {
23777
23783
  var _a, _b, _c;
@@ -23780,7 +23786,7 @@ const RtkScreenshareView = class {
23780
23786
  const icon = this.isFullScreen
23781
23787
  ? this.iconPack.full_screen_minimize
23782
23788
  : this.iconPack.full_screen_maximize;
23783
- return (h(Host, { key: '0de66f829d0426af746b72561e7470c50c703060', class: { isSelf } }, h("div", { key: "video-container", id: "video-container", class: { expand: this.videoExpanded } }, h("video", { key: '2e56da582533ee6a8286483fa4495ff9a88453a0', ref: (el) => (this.videoEl = el), class: {
23789
+ return (h(Host, { key: '194efb9fa8783a441c8050ebab07a2d3546446bf', class: { isSelf } }, h("div", { key: "video-container", id: "video-container", class: { expand: this.videoExpanded } }, h("video", { key: 'de008c1a856ba19e766c03b71b1be492a9975261', ref: this.onVideoRef, class: {
23784
23790
  visible: this.screenShareEnabled,
23785
23791
  'fit-in-container': this.participant.supportsRemoteControl,
23786
23792
  }, playsInline: true, onPlay: () => {
@@ -23788,15 +23794,15 @@ const RtkScreenshareView = class {
23788
23794
  screenshareParticipant: this.participant,
23789
23795
  participant: this.meeting.self,
23790
23796
  });
23791
- }, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && isFullScreenSupported() && (h("rtk-tooltip", { key: '7cd30b509e71685bb28615fd0eeb289764bc6f4b', label: text }, h("rtk-button", { key: '0610dd55ad5a29cdbb77c61ed024253a70c66020', id: "full-screen-btn", kind: "icon", onClick: this.toggleFullScreen, title: text }, h("rtk-icon", { key: '1ea3a04938cb5836afcf171fa881916f1a63da79', icon: icon, "aria-hidden": true, tabIndex: -1 }))))), isSelf && (h("div", { id: "self-message", key: "self-message" }, h("h3", { key: '4758cad86ab2453cbfbf9276e9db8f4f45889e4a' }, this.t('screenshare.shared')), h("div", { key: '136f80c0f74bbc9d860dfc9a5f2f04531dc9fe80', class: "actions" }, this.meeting != null && (h("rtk-button", { key: '2588174e0054805565c0ae9d3d7001d812c25d6c', variant: "danger", onClick: () => {
23797
+ }, autoPlay: true, muted: true, id: `screen-share-video-${this.participant.id}` })), h("div", { id: "controls", key: "controls" }, !this.hideFullScreenButton && !isSelf && isFullScreenSupported() && (h("rtk-tooltip", { key: 'bf9a96bcba99bb9cf13bbcf572e5a9b71d53498b', label: text }, h("rtk-button", { key: '06a5eb9396056114d9e1a339454e782b9c533a9b', id: "full-screen-btn", kind: "icon", onClick: this.toggleFullScreen, title: text }, h("rtk-icon", { key: 'fa4e499769a910ceb9b2bffa6668db83adbad135', icon: icon, "aria-hidden": true, tabIndex: -1 }))))), isSelf && (h("div", { id: "self-message", key: "self-message" }, h("h3", { key: '1650592e64dd44004a53ccc168ab7138c78ea7f4' }, this.t('screenshare.shared')), h("div", { key: 'd09216ab62012e1d2d445b8f080ae18786fc197e', class: "actions" }, this.meeting != null && (h("rtk-button", { key: 'f4e8c65eaaf40190eb566eb473d7932411731793', variant: "danger", onClick: () => {
23792
23798
  this.meeting.self.disableScreenShare();
23793
- } }, h("rtk-icon", { key: '10de1c2c538cc069d5ea9c4a8e89699cdb06e970', icon: this.iconPack.share_screen_stop, slot: "start" }), this.t('screenshare.stop'))), this.meeting != null && (h("rtk-button", { key: '916802524a950adadd39eac97660d05034840a8b', variant: "secondary", disabled: this.isSwitchingScreen, onClick: this.shareDifferentScreen }, h("rtk-icon", { key: '5142a5fe580a7c900d7435e5c638bef0533a289b', icon: (_c = this.iconPack.share_screen_different) !== null && _c !== void 0 ? _c : this.iconPack.share_screen_start, slot: "start" }), this.t('screenshare.share_different_screen'))), h("rtk-button", { key: '6b024ca8b2b537b84862f96f35ab1e2a9832c974', variant: "secondary", id: "expand-btn", onClick: () => {
23799
+ } }, h("rtk-icon", { key: '215fd1e658442e6f9c70ee5f7cabcd22e0901886', icon: this.iconPack.share_screen_stop, slot: "start" }), this.t('screenshare.stop'))), this.meeting != null && (h("rtk-button", { key: 'a73b3774901661020ef20e9e48dc81a4277cc471', variant: "secondary", disabled: this.isSwitchingScreen, onClick: this.shareDifferentScreen }, h("rtk-icon", { key: 'f9a4304e8cb648f5f2ca6ee650f6b512e86f1833', icon: (_c = this.iconPack.share_screen_different) !== null && _c !== void 0 ? _c : this.iconPack.share_screen_start, slot: "start" }), this.t('screenshare.share_different_screen'))), h("rtk-button", { key: 'b2f93bd50018b9a727860014d0d4c33ab8a23334', variant: "secondary", id: "expand-btn", onClick: () => {
23794
23800
  this.videoExpanded = !this.videoExpanded;
23795
- } }, h("rtk-icon", { key: 'aef5ba226ba681c6ec6d11f0ac78c03329a88f27', icon: this.videoExpanded
23801
+ } }, h("rtk-icon", { key: '40d5bb9a3dfc648035b946ced0c584b3a6312100', icon: this.videoExpanded
23796
23802
  ? this.iconPack.full_screen_minimize
23797
23803
  : this.iconPack.full_screen_maximize, slot: "start" }), this.videoExpanded
23798
23804
  ? this.t('screenshare.min_preview')
23799
- : this.t('screenshare.max_preview'))))), h("slot", { key: 'f21ad85d1847864f268d1fa33235467f14de2420' })));
23805
+ : this.t('screenshare.max_preview'))))), h("slot", { key: 'a2908fef4320f0bf4408a6a07d2ba4bea0acdc4c' })));
23800
23806
  }
23801
23807
  get host() { return getElement(this); }
23802
23808
  static get watchers() { return {