@beterdichtbij/component-library 0.66.0-alpha.10 → 0.66.0-alpha.12

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.
@@ -191217,17 +191217,19 @@ var gBe = { class: "video-call-template" }, _Be = {
191217
191217
  Ke();
191218
191218
  });
191219
191219
  function V() {
191220
- S.value = Z9;
191220
+ console.log("CallDeclined"), S.value = Z9;
191221
+ }
191222
+ function H() {
191223
+ console.log("CallAnswered");
191221
191224
  }
191222
- function H() {}
191223
191225
  function ye() {
191224
- S.value !== $9 && T.agent && (!T.call || T.call.state === "Disconnected") && we();
191226
+ console.log("CallStartVideoCall"), S.value !== $9 && !i.isCallee && we();
191225
191227
  }
191226
191228
  async function be() {
191227
- S.value = FBe, x.value.video && He();
191229
+ console.log("CallHangUp"), S.value = FBe, x.value.video && He();
191228
191230
  }
191229
191231
  async function xe(e) {
191230
- T.client = w(new G9());
191232
+ console.log("InitializeAcsConnection"), T.client = w(new G9());
191231
191233
  let t = new Hue(e);
191232
191234
  T.agent = w(await T.client.createCallAgent(t)), T.deviceManager = await T.client.getDeviceManager(), x.value = await T.deviceManager.askDevicePermission({
191233
191235
  video: !0,
@@ -191235,7 +191237,7 @@ var gBe = { class: "video-call-template" }, _Be = {
191235
191237
  }), ie.value = window.setInterval(He, 5e3), (!x.value.audio || !x.value.video) && (S.value = $9), i.isCallee && (T.agent.on("incomingCall", Se), o("ready"));
191236
191238
  }
191237
191239
  async function Se(e) {
191238
- if (!N.value) try {
191240
+ if (console.log("SetIncomingCall"), !N.value) try {
191239
191241
  N.value = !0, T.incomingCall = e.incomingCall, await Te();
191240
191242
  } catch {
191241
191243
  console.log("error occured during starting call");
@@ -191244,30 +191246,37 @@ var gBe = { class: "video-call-template" }, _Be = {
191244
191246
  }
191245
191247
  }
191246
191248
  async function Ce() {
191249
+ console.log("CreateNewVideoOptions");
191247
191250
  let e = await Ee();
191248
191251
  return e ? { localVideoStreams: [e] } : void 0;
191249
191252
  }
191250
191253
  async function we() {
191254
+ console.log("StartCall");
191251
191255
  try {
191252
- if (!T.agent || !i.participant?.videoCallIdentityId || T.call && T.call.state !== "Disconnected") return;
191253
- let e = await Ce(), t = { communicationUserId: i.participant.videoCallIdentityId };
191254
- T.call = T.agent.startCall([t], { videoOptions: e }), Oe(), De();
191256
+ let e = { videoOptions: await Ce() }, t = [{ communicationUserId: i.participant.videoCallIdentityId }];
191257
+ T.call = T.agent.startCall(t, e), Oe(), De();
191255
191258
  } catch (e) {
191256
191259
  console.error(e);
191257
191260
  }
191258
191261
  }
191259
191262
  async function Te() {
191260
- if (!T.incomingCall || T.call && T.call.state !== "Disconnected") return;
191263
+ console.log("AcceptCall");
191261
191264
  let e = await Ce();
191262
- T.call = await T.incomingCall.accept({ videoOptions: e }), Oe(), De();
191265
+ try {
191266
+ T.call = await T.incomingCall.accept({ videoOptions: e });
191267
+ } catch (e) {
191268
+ console.error(e);
191269
+ }
191270
+ Oe(), De();
191263
191271
  }
191264
191272
  async function Ee() {
191273
+ console.log("CreateLocalVideoStream");
191265
191274
  let e = (await T.deviceManager.getCameras())[0];
191266
191275
  if (e) return new Z6(e);
191267
191276
  console.error("No camera device found on the system");
191268
191277
  }
191269
191278
  function De() {
191270
- T.call.on("stateChanged", Me), T.call.on("localVideoStreamsUpdated", (e) => {
191279
+ console.log("SubscribeToCall"), T.call.on("stateChanged", Me), T.call.on("localVideoStreamsUpdated", (e) => {
191271
191280
  e.added.forEach(Pe), e.removed.forEach(Ne);
191272
191281
  }), T.call.remoteParticipants.forEach(Ie), T.call.on("remoteParticipantsUpdated", (e) => {
191273
191282
  e.added.forEach(Ie);
@@ -191276,13 +191285,13 @@ var gBe = { class: "video-call-template" }, _Be = {
191276
191285
  });
191277
191286
  }
191278
191287
  function Oe() {
191279
- C.value = T.call.feature($5.UserFacingDiagnostics), C.value.media.on("diagnosticChanged", je), C.value.network.on("diagnosticChanged", je);
191288
+ console.log("SubscribeToDiagnostics"), C.value = T.call.feature($5.UserFacingDiagnostics), C.value.media.on("diagnosticChanged", je), C.value.network.on("diagnosticChanged", je);
191280
191289
  }
191281
191290
  function je(e) {
191282
- (e.diagnostic === "networkReceiveQuality" || e.diagnostic === "networkSendQuality") && (e.value === r6.Bad ? (console.error(`${e.diagnostic} is bad quality`), b.value = 0) : e.value === r6.Poor ? (console.error(`${e.diagnostic} is poor quality`), b.value = 1) : b.value = 2);
191291
+ console.log("DiagnosticChangedListener"), (e.diagnostic === "networkReceiveQuality" || e.diagnostic === "networkSendQuality") && (e.value === r6.Bad ? (console.error(`${e.diagnostic} is bad quality`), b.value = 0) : e.value === r6.Poor ? (console.error(`${e.diagnostic} is poor quality`), b.value = 1) : b.value = 2);
191283
191292
  }
191284
191293
  function Me() {
191285
- switch (console.log("Call state changed to: " + T.call.state), T.call.state) {
191294
+ switch (console.log("CallStateIsChanged", T.call.state), T.call.state) {
191286
191295
  case "EarlyMedia":
191287
191296
  S.value = Q9;
191288
191297
  break;
@@ -191298,7 +191307,7 @@ var gBe = { class: "video-call-template" }, _Be = {
191298
191307
  }
191299
191308
  }
191300
191309
  async function Ne(e) {
191301
- if (!e || e.mediaStreamType !== "ScreenSharing" || !k.value) return;
191310
+ if (console.log("RemoveLocalScreenShareStream"), !e || e.mediaStreamType !== "ScreenSharing" || !k.value) return;
191302
191311
  k.value.dispose();
191303
191312
  let t = document.querySelector(".outgoing__screenshare");
191304
191313
  t.style.display = "none";
@@ -191306,7 +191315,7 @@ var gBe = { class: "video-call-template" }, _Be = {
191306
191315
  n.style.display = "flex";
191307
191316
  }
191308
191317
  async function Pe(e) {
191309
- if (!e || e.mediaStreamType !== "ScreenSharing") return;
191318
+ if (console.log("DisplayLocalScreenShareStream"), !e || e.mediaStreamType !== "ScreenSharing") return;
191310
191319
  k.value = await new A7(e).createView();
191311
191320
  let t = document.querySelector(".outgoing__screenshare");
191312
191321
  t.replaceChildren(k.value.target), t.style.display = "flex";
@@ -191316,7 +191325,7 @@ var gBe = { class: "video-call-template" }, _Be = {
191316
191325
  r.style.objectFit = "contain";
191317
191326
  }
191318
191327
  async function Fe(e) {
191319
- if (e && e.source && E.value && E.value.source && E.value.source.id == e.source.id) return !0;
191328
+ if (console.log("DisplayLocalVideoStream"), e && e.source && E.value && E.value.source && E.value.source.id == e.source.id) return !0;
191320
191329
  try {
191321
191330
  ee.value = new A7(e);
191322
191331
  let t = await ee.value.createView(), n = document.querySelector(".outgoing__video");
@@ -191327,34 +191336,36 @@ var gBe = { class: "video-call-template" }, _Be = {
191327
191336
  return E.value = e, !0;
191328
191337
  }
191329
191338
  async function Ie(e) {
191330
- e.videoStreams.forEach(Le), e.on("videoStreamsUpdated", (e) => {
191339
+ console.log("SubscribeToRemoteParticipant"), e.videoStreams.forEach(Le), e.on("videoStreamsUpdated", (e) => {
191331
191340
  e.added.forEach(Le);
191332
191341
  });
191333
191342
  }
191334
191343
  async function Le(e) {
191335
- if (e.mediaStreamType === "Video" && (await Re(e), e.on("isAvailableChanged", async () => await Re(e))), e.mediaStreamType === "ScreenSharing" && e.on("isAvailableChanged", Be), e.mediaStreamType === "ScreenSharing" && e.isAvailable) {
191344
+ if (console.log("DisplayRemoteVideoStream"), e.mediaStreamType === "Video" && (await Re(e), e.on("isAvailableChanged", async () => await Re(e))), e.mediaStreamType === "ScreenSharing" && e.on("isAvailableChanged", Be), e.mediaStreamType === "ScreenSharing" && e.isAvailable) {
191336
191345
  O.value = new A7(e);
191337
191346
  let t = await O.value.createView(), n = document.querySelector(".incoming__screenshare");
191338
191347
  ze(!0), y.value = !0, Ue(".incoming__screenshare"), n.replaceChildren(t.target);
191339
191348
  }
191340
191349
  }
191341
191350
  async function Re(e) {
191342
- if (!e.isAvailable) return;
191351
+ if (console.log("RenderVideo"), !e.isAvailable) return;
191343
191352
  O.value = new A7(e);
191344
191353
  let t = await O.value.createView(), n = document.querySelector(".incoming__video");
191345
191354
  n.hidden = !1, n.replaceChildren(t.target), Ue(".incoming__video"), ze(!1);
191346
191355
  }
191347
191356
  function ze(e) {
191357
+ console.log("HideCameraStream");
191348
191358
  let t = document.querySelector(".incoming__video"), n = document.querySelector(".incoming__screenshare");
191349
191359
  t.style.display = e ? "none" : "block", n.style.display = e ? "flex" : "none";
191350
191360
  }
191351
191361
  function Be() {
191352
- y.value = !1, ze(!1);
191362
+ console.log("ScreenSharingAvailabilityChanged"), y.value = !1, ze(!1);
191353
191363
  }
191354
191364
  async function Ve() {
191355
- He(!0);
191365
+ console.log("SwitchLocalVideoStream"), He(!0);
191356
191366
  }
191357
191367
  async function He(e = !1) {
191368
+ console.log("DisplayAvailableLocalVideoStream");
191358
191369
  let t = T.call?.state;
191359
191370
  if (t === "Connecting" || t === "EarlyMedia") return;
191360
191371
  let n = (await T.deviceManager.getCameras()).filter((e) => e.name != "OBS Virtual Camera");
@@ -191366,32 +191377,34 @@ var gBe = { class: "video-call-template" }, _Be = {
191366
191377
  }
191367
191378
  }
191368
191379
  function Ue(e) {
191380
+ console.log("EnableMiniPlayerOnVideoElement");
191369
191381
  let t = document.querySelector(e);
191370
191382
  if (!t) return;
191371
191383
  let n = t.querySelector("video");
191372
191384
  n && (n.style.objectFit = "contain", n.disablePictureInPicture = !1);
191373
191385
  }
191374
191386
  async function We() {
191375
- T.call && T.call.state !== "Disconnected" && (await T.call.hangUp({ forEveryone: !0 }), await T.agent.dispose()), o("end-video-call"), window.close();
191387
+ console.log("EndVideoCall"), T.call && T.call.state !== "Disconnected" && (await T.call.hangUp({ forEveryone: !0 }), await T.agent.dispose()), o("end-video-call"), window.close();
191376
191388
  }
191377
191389
  function Ge() {
191378
- window.close();
191390
+ console.log("CloseWindow"), window.close();
191379
191391
  }
191380
191392
  function Ke() {
191381
- _oe("verbose"), goe.log = (...e) => {
191393
+ console.log("InitAzureLogger"), _oe("verbose"), goe.log = (...e) => {
191382
191394
  let t = [...e];
191383
191395
  f.value = f.value.splice(1 - LBe).concat(t);
191384
191396
  };
191385
191397
  }
191386
191398
  function qe() {
191387
- document.querySelector(ve.value).querySelector("video").requestFullscreen();
191399
+ console.log("ChangeToFullscreen"), document.querySelector(ve.value).querySelector("video").requestFullscreen();
191388
191400
  }
191389
191401
  function Je() {
191402
+ console.log("ChangeToMiniPlayer");
191390
191403
  let e = document.querySelector(ve.value).querySelector("video");
191391
191404
  document.pictureInPictureElement ? e.exitPictureInPicture() : document.pictureInPictureEnabled && e.requestPictureInPicture();
191392
191405
  }
191393
191406
  async function Ye() {
191394
- T.call && T.call.isScreenSharingOn ? await T.call.stopScreenSharing() : await T.call.startScreenSharing();
191407
+ console.log("OnShareScreen"), T.call && T.call.isScreenSharingOn ? await T.call.stopScreenSharing() : await T.call.startScreenSharing();
191395
191408
  }
191396
191409
  return n({
191397
191410
  CallDeclined: V,