@vapi-ai/web 1.0.197 → 1.0.199

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.
Files changed (3) hide show
  1. package/dist/vapi.js +5 -5
  2. package/package.json +1 -1
  3. package/vapi.ts +5 -5
package/dist/vapi.js CHANGED
@@ -38,12 +38,12 @@ function buildAudioPlayer(track, participantId) {
38
38
  return player;
39
39
  });
40
40
  }
41
- function subscribeToTracks(sessionId, call) {
42
- console.log(sessionId);
43
- if (sessionId === "local") {
41
+ function subscribeToTracks(e, call) {
42
+ console.log(e);
43
+ if (e.participant.user_id === "local") {
44
44
  return;
45
45
  }
46
- call.updateParticipant(sessionId, {
46
+ call.updateParticipant(e.participant.session_id, {
47
47
  setSubscribedTracks: {
48
48
  audio: true,
49
49
  video: false,
@@ -103,7 +103,7 @@ class Vapi extends events_1.default {
103
103
  this.call.on("participant-joined", (e) => {
104
104
  if (!e || !this.call)
105
105
  return;
106
- subscribeToTracks(e.participant.session_id, this.call);
106
+ subscribeToTracks(e, this.call);
107
107
  });
108
108
  yield this.call.join({ url, subscribeToTracksAutomatically: false });
109
109
  this.call.startRemoteParticipantsAudioLevelObserver();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vapi-ai/web",
3
- "version": "1.0.197",
3
+ "version": "1.0.199",
4
4
  "description": "",
5
5
  "main": "dist/vapi.js",
6
6
  "types": "dist/vapi.d.ts",
package/vapi.ts CHANGED
@@ -30,12 +30,12 @@ async function buildAudioPlayer(track: any, participantId: string) {
30
30
  await startPlayer(player, track);
31
31
  return player;
32
32
  }
33
- function subscribeToTracks(sessionId: string, call: DailyCall) {
34
- console.log(sessionId);
35
- if (sessionId === "local") {
33
+ function subscribeToTracks(e: DailyEventObjectParticipant, call: DailyCall) {
34
+ console.log(e);
35
+ if (e.participant.user_id === "local") {
36
36
  return;
37
37
  }
38
- call.updateParticipant(sessionId, {
38
+ call.updateParticipant(e.participant.session_id, {
39
39
  setSubscribedTracks: {
40
40
  audio: true,
41
41
  video: false,
@@ -101,7 +101,7 @@ export default class Vapi extends EventEmitter {
101
101
 
102
102
  this.call.on("participant-joined", (e) => {
103
103
  if (!e || !this.call) return;
104
- subscribeToTracks(e.participant.session_id, this.call);
104
+ subscribeToTracks(e, this.call);
105
105
  });
106
106
 
107
107
  await this.call.join({ url, subscribeToTracksAutomatically: false });