vani-meeting-client 0.7.0 → 0.7.3

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.
@@ -1,8 +1,10 @@
1
1
  import { BaseVideoCallHandler } from "./BaseVideoCallHandler";
2
2
  import { WebSocketMessageBody } from "../websocket-handler/WebsocketHandler";
3
3
  import { Track } from "../model/Track";
4
+ import { MeetingStartRequest } from '..';
5
+ import { CommunicationHandler } from '../inter-communication-handler/CommunicationHandler';
4
6
  export declare class SFUHandler extends BaseVideoCallHandler {
5
- private device;
7
+ private device?;
6
8
  private transportCallBacks;
7
9
  private routerRtpCapabilities?;
8
10
  private sendTransport?;
@@ -12,6 +14,7 @@ export declare class SFUHandler extends BaseVideoCallHandler {
12
14
  private consumers;
13
15
  private dataProducers;
14
16
  private dataConsumer;
17
+ constructor(_meetingStartRequest: MeetingStartRequest, _communicationHandler: CommunicationHandler);
15
18
  onReconnect(): Promise<void>;
16
19
  stopTrack(track: Track): void;
17
20
  pauseTrack(track: Track): void;
@@ -62,21 +62,33 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
62
62
  };
63
63
  import log from 'loglevel';
64
64
  import { BaseVideoCallHandler } from "./BaseVideoCallHandler";
65
- import { Device } from 'mediasoup-client';
65
+ import { detectDevice, Device } from 'mediasoup-client';
66
66
  import { SFUMessageType } from "../websocket-handler/WebsocketHandler";
67
67
  import { Track, TrackKind } from "../model/Track";
68
68
  import { VaniEvent } from '..';
69
69
  var SFUHandler = /** @class */ (function (_super) {
70
70
  __extends(SFUHandler, _super);
71
- function SFUHandler() {
72
- var _this = _super !== null && _super.apply(this, arguments) || this;
73
- _this.device = new Device();
71
+ function SFUHandler(_meetingStartRequest, _communicationHandler) {
72
+ var _this = _super.call(this, _meetingStartRequest, _communicationHandler) || this;
73
+ _this.device = undefined;
74
74
  _this.transportCallBacks = {};
75
75
  _this.isProduceTrackIntialWorkDone = false;
76
76
  _this.producers = [];
77
77
  _this.consumers = [];
78
78
  _this.dataProducers = [];
79
79
  _this.dataConsumer = [];
80
+ var handlerName = detectDevice();
81
+ if (handlerName) {
82
+ console.log("detected handler: %s", handlerName);
83
+ }
84
+ else {
85
+ console.warn("no suitable handler found for current browser/device");
86
+ }
87
+ try {
88
+ _this.device = new Device();
89
+ }
90
+ catch (err) {
91
+ }
80
92
  return _this;
81
93
  }
82
94
  SFUHandler.prototype.onReconnect = function () {
@@ -228,15 +240,17 @@ var SFUHandler = /** @class */ (function (_super) {
228
240
  });
229
241
  };
230
242
  SFUHandler.prototype.onParticipantUpdated = function () {
231
- if (!this.communicationHandler || this.communicationHandler.getAllParticipants().length < 2) {
232
- this.producers.forEach(function (producer) {
233
- producer.pause();
234
- });
235
- }
236
- else {
237
- this.producers.forEach(function (producer) {
238
- producer.resume();
239
- });
243
+ if (this.producers) {
244
+ if (!this.communicationHandler || this.communicationHandler.getAllParticipants().length < 2) {
245
+ this.producers.forEach(function (producer) {
246
+ producer.pause();
247
+ });
248
+ }
249
+ else {
250
+ this.producers.forEach(function (producer) {
251
+ producer.resume();
252
+ });
253
+ }
240
254
  }
241
255
  };
242
256
  SFUHandler.prototype.sendMessageViaDataChannel = function (messagePayload) {
@@ -530,11 +544,13 @@ var SFUHandler = /** @class */ (function (_super) {
530
544
  this.consumerTransport.close();
531
545
  this.consumerTransport = undefined;
532
546
  }
533
- this.producers.forEach(function (producer) {
534
- if (producer.closed === false) {
535
- producer.close();
536
- }
537
- });
547
+ if (this.producers) {
548
+ this.producers.forEach(function (producer) {
549
+ if (producer.closed === false) {
550
+ producer.close();
551
+ }
552
+ });
553
+ }
538
554
  this.dataProducers.forEach(function (producer) {
539
555
  if (producer.closed === false) {
540
556
  producer.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "0.7.0",
3
+ "version": "0.7.3",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  "analytics": "^0.7.21",
47
47
  "axios": "^0.24.0",
48
48
  "loglevel": "^1.8.0",
49
- "mediasoup-client": "^3.6.47",
49
+ "mediasoup-client": "^3.6.56",
50
50
  "react-native-google-analytics-bridge": "^7.1.0"
51
51
  },
52
52
  "optionalDependencies": {}