@myinterview/widget-react 1.0.56-experimental-15 → 1.0.56-experimental-8647f49-4c92db4

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/cjs/index.js CHANGED
@@ -32072,6 +32072,16 @@ const SentryTrackingFn = (event, context, name, level) => {
32072
32072
  SentryHub.captureMessage(name, level);
32073
32073
  });
32074
32074
  };
32075
+ const SentryBreadcrumb = ({ type, level, event_id, category, message, data }) => {
32076
+ SentryHub.addBreadcrumb({
32077
+ type,
32078
+ level,
32079
+ event_id,
32080
+ category,
32081
+ message,
32082
+ data,
32083
+ });
32084
+ };
32075
32085
 
32076
32086
  const PlayIcon = ({ playing }) => (React__default["default"].createElement("div", { className: "myinterview-widget-icons__play-button" },
32077
32087
  React__default["default"].createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%", fill: "currentColor", viewBox: "0 0 50 50" },
@@ -43234,6 +43244,7 @@ var STATES$3;
43234
43244
  })(STATES$3 || (STATES$3 = {}));
43235
43245
  var ACTIONS$3;
43236
43246
  (function (ACTIONS) {
43247
+ ACTIONS["COLLECT_BREADCRUMB"] = "collectBreadcrumb";
43237
43248
  ACTIONS["INIT_WEB_WORKER"] = "initWebWorker";
43238
43249
  ACTIONS["CONSOLE_LOG"] = "consoleLog";
43239
43250
  ACTIONS["SET_MEDIA_STREAM"] = "setMediaStream";
@@ -43395,7 +43406,7 @@ const microphoneMachine = createMachine({
43395
43406
  },
43396
43407
  },
43397
43408
  [STATES$3.NOT_RECEIVING_DATA]: {
43398
- entry: [
43409
+ entry: [ACTIONS$3.COLLECT_BREADCRUMB,
43399
43410
  sendParent((context, event) => ({
43400
43411
  data: recorderErrors.NoSoundError,
43401
43412
  type: EVENTS$5.RECORDER_DEVICE_ERROR,
@@ -43426,6 +43437,22 @@ const microphoneMachine = createMachine({
43426
43437
  },
43427
43438
  }, {
43428
43439
  actions: {
43440
+ [ACTIONS$3.COLLECT_BREADCRUMB]: (context) => {
43441
+ var _a, _b, _c;
43442
+ SentryBreadcrumb({
43443
+ type: 'debug',
43444
+ level: 'warning',
43445
+ category: 'mic',
43446
+ message: 'mic is inactive, this is the status of audioTrack',
43447
+ data: {
43448
+ audioTrack: {
43449
+ enabled: (_a = context === null || context === void 0 ? void 0 : context.mediaStream) === null || _a === void 0 ? void 0 : _a.getAudioTracks()[0].enabled,
43450
+ label: (_b = context === null || context === void 0 ? void 0 : context.mediaStream) === null || _b === void 0 ? void 0 : _b.getAudioTracks()[0].label,
43451
+ muted: (_c = context === null || context === void 0 ? void 0 : context.mediaStream) === null || _c === void 0 ? void 0 : _c.getAudioTracks()[0].muted,
43452
+ },
43453
+ },
43454
+ });
43455
+ },
43429
43456
  [ACTIONS$3.INIT_WEB_WORKER]: assign({
43430
43457
  webWorker: (context, _event) => (context.mediaStream ? new Builder(Worker$1) : null),
43431
43458
  }),
@@ -43490,6 +43517,14 @@ const microphoneMachine = createMachine({
43490
43517
  };
43491
43518
  }
43492
43519
  getVolume(0);
43520
+ ctx.onstatechange = () => {
43521
+ var _a, _b;
43522
+ if (ctx.state === 'suspended') {
43523
+ SentryTrackingFn({ type: 'status === suspended', data: ctx.state }, { label: (_a = context === null || context === void 0 ? void 0 : context.mediaStream) === null || _a === void 0 ? void 0 : _a.getAudioTracks()[0].label,
43524
+ muted: (_b = context === null || context === void 0 ? void 0 : context.mediaStream) === null || _b === void 0 ? void 0 : _b.getAudioTracks()[0].muted,
43525
+ status: ctx.state }, 'mic onstatechange', 'fatal');
43526
+ }
43527
+ };
43493
43528
  return () => {
43494
43529
  var _a;
43495
43530
  mic = null;