Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@daily-co/daily-vcs-web

Package Overview
Dependencies
Maintainers
21
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@daily-co/daily-vcs-web - npm Package Compare versions

Comparing version 0.0.1-alpha.3 to 0.0.1-alpha.4

dist/typings/lib/videoUtils.d.ts

107

dist/index.cjs.js

@@ -49,2 +49,42 @@ 'use strict';

const createVideoObject = (p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: p.user_name || 'Guest',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'camera',
});
};
const createScreenshareObject = (p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.screenVideo) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: '',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.screenVideo) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'screenshare',
});
};
const createPeerObject = (p) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
return ({
id: p.session_id,
displayName: p.user_name || 'Guest',
video: {
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
paused: isTrackOff((_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.state),
},
audio: {},
screenshareVideo: {
id: (_k = (_j = (_h = (_g = p === null || p === void 0 ? void 0 : p.tracks) === null || _g === void 0 ? void 0 : _g.screenVideo) === null || _h === void 0 ? void 0 : _h.track) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : '',
paused: isTrackOff((_m = (_l = p === null || p === void 0 ? void 0 : p.tracks) === null || _l === void 0 ? void 0 : _l.screenVideo) === null || _m === void 0 ? void 0 : _m.state),
},
screenshareAudio: {},
});
};
const MAX_VIDEO_INPUT_SLOTS = 20;

@@ -251,51 +291,24 @@ const DEFAULT_ASPECT_RATIO = 16 / 9;

handleParticipantsChange() {
const participants = Object.values(this.callObject.participants());
var _a, _b, _c, _d;
const participants = Object.fromEntries(Object.values(this.callObject.participants()).map((p) => [
p.session_id,
p,
]));
const filteredParticipants = this.participantIds.length > 0
? participants.filter((p) => this.participantIds.includes(p.session_id))
: participants;
const videos = filteredParticipants
.filter((p) => { var _a, _b; return !isTrackOff((_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.state); })
.map((p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: p.user_name || 'Guest',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'camera',
});
});
const screens = filteredParticipants
.filter((p) => { var _a, _b; return !isTrackOff((_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.screenVideo) === null || _b === void 0 ? void 0 : _b.state); })
.map((p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.screenVideo) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: '',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.screenVideo) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'screenshare',
});
});
? this.participantIds.map((id) => participants[id]).filter(Boolean)
: Object.values(participants);
const videos = [];
const screens = [];
const peers = new Map();
for (const p of filteredParticipants) {
if (!isTrackOff((_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.state)) {
videos.push(createVideoObject(p));
}
if (!isTrackOff((_d = (_c = p === null || p === void 0 ? void 0 : p.tracks) === null || _c === void 0 ? void 0 : _c.screenVideo) === null || _d === void 0 ? void 0 : _d.state)) {
screens.push(createScreenshareObject(p));
}
peers.set(p.session_id, createPeerObject(p));
}
this.applyTracks([...videos, ...screens]);
const peers = filteredParticipants.map((p) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
return ({
id: p.session_id,
displayName: p.user_name || 'Guest',
video: {
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
paused: isTrackOff((_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.state),
},
audio: {},
screenshareVideo: {
id: (_k = (_j = (_h = (_g = p === null || p === void 0 ? void 0 : p.tracks) === null || _g === void 0 ? void 0 : _g.screenVideo) === null || _h === void 0 ? void 0 : _h.track) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : '',
paused: isTrackOff((_m = (_l = p === null || p === void 0 ? void 0 : p.tracks) === null || _l === void 0 ? void 0 : _l.screenVideo) === null || _m === void 0 ? void 0 : _m.state),
},
screenshareAudio: {},
});
});
this.vcsApi.setRoomPeers(peers);
this.vcsApi.setRoomPeerDescriptionsById(peers);
}

@@ -302,0 +315,0 @@ setupEventListeners() {

@@ -47,2 +47,42 @@ /******************************************************************************

const createVideoObject = (p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: p.user_name || 'Guest',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'camera',
});
};
const createScreenshareObject = (p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.screenVideo) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: '',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.screenVideo) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'screenshare',
});
};
const createPeerObject = (p) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
return ({
id: p.session_id,
displayName: p.user_name || 'Guest',
video: {
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
paused: isTrackOff((_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.state),
},
audio: {},
screenshareVideo: {
id: (_k = (_j = (_h = (_g = p === null || p === void 0 ? void 0 : p.tracks) === null || _g === void 0 ? void 0 : _g.screenVideo) === null || _h === void 0 ? void 0 : _h.track) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : '',
paused: isTrackOff((_m = (_l = p === null || p === void 0 ? void 0 : p.tracks) === null || _l === void 0 ? void 0 : _l.screenVideo) === null || _m === void 0 ? void 0 : _m.state),
},
screenshareAudio: {},
});
};
const MAX_VIDEO_INPUT_SLOTS = 20;

@@ -249,51 +289,24 @@ const DEFAULT_ASPECT_RATIO = 16 / 9;

handleParticipantsChange() {
const participants = Object.values(this.callObject.participants());
var _a, _b, _c, _d;
const participants = Object.fromEntries(Object.values(this.callObject.participants()).map((p) => [
p.session_id,
p,
]));
const filteredParticipants = this.participantIds.length > 0
? participants.filter((p) => this.participantIds.includes(p.session_id))
: participants;
const videos = filteredParticipants
.filter((p) => { var _a, _b; return !isTrackOff((_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.state); })
.map((p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: p.user_name || 'Guest',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'camera',
});
});
const screens = filteredParticipants
.filter((p) => { var _a, _b; return !isTrackOff((_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.screenVideo) === null || _b === void 0 ? void 0 : _b.state); })
.map((p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.screenVideo) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: '',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.screenVideo) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'screenshare',
});
});
? this.participantIds.map((id) => participants[id]).filter(Boolean)
: Object.values(participants);
const videos = [];
const screens = [];
const peers = new Map();
for (const p of filteredParticipants) {
if (!isTrackOff((_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.state)) {
videos.push(createVideoObject(p));
}
if (!isTrackOff((_d = (_c = p === null || p === void 0 ? void 0 : p.tracks) === null || _c === void 0 ? void 0 : _c.screenVideo) === null || _d === void 0 ? void 0 : _d.state)) {
screens.push(createScreenshareObject(p));
}
peers.set(p.session_id, createPeerObject(p));
}
this.applyTracks([...videos, ...screens]);
const peers = filteredParticipants.map((p) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
return ({
id: p.session_id,
displayName: p.user_name || 'Guest',
video: {
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
paused: isTrackOff((_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.state),
},
audio: {},
screenshareVideo: {
id: (_k = (_j = (_h = (_g = p === null || p === void 0 ? void 0 : p.tracks) === null || _g === void 0 ? void 0 : _g.screenVideo) === null || _h === void 0 ? void 0 : _h.track) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : '',
paused: isTrackOff((_m = (_l = p === null || p === void 0 ? void 0 : p.tracks) === null || _l === void 0 ? void 0 : _l.screenVideo) === null || _m === void 0 ? void 0 : _m.state),
},
screenshareAudio: {},
});
});
this.vcsApi.setRoomPeers(peers);
this.vcsApi.setRoomPeerDescriptionsById(peers);
}

@@ -300,0 +313,0 @@ setupEventListeners() {

@@ -53,2 +53,42 @@ (function (global, factory) {

const createVideoObject = (p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: p.user_name || 'Guest',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'camera',
});
};
const createScreenshareObject = (p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.screenVideo) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: '',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.screenVideo) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'screenshare',
});
};
const createPeerObject = (p) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
return ({
id: p.session_id,
displayName: p.user_name || 'Guest',
video: {
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
paused: isTrackOff((_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.state),
},
audio: {},
screenshareVideo: {
id: (_k = (_j = (_h = (_g = p === null || p === void 0 ? void 0 : p.tracks) === null || _g === void 0 ? void 0 : _g.screenVideo) === null || _h === void 0 ? void 0 : _h.track) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : '',
paused: isTrackOff((_m = (_l = p === null || p === void 0 ? void 0 : p.tracks) === null || _l === void 0 ? void 0 : _l.screenVideo) === null || _m === void 0 ? void 0 : _m.state),
},
screenshareAudio: {},
});
};
const MAX_VIDEO_INPUT_SLOTS = 20;

@@ -255,51 +295,24 @@ const DEFAULT_ASPECT_RATIO = 16 / 9;

handleParticipantsChange() {
const participants = Object.values(this.callObject.participants());
var _a, _b, _c, _d;
const participants = Object.fromEntries(Object.values(this.callObject.participants()).map((p) => [
p.session_id,
p,
]));
const filteredParticipants = this.participantIds.length > 0
? participants.filter((p) => this.participantIds.includes(p.session_id))
: participants;
const videos = filteredParticipants
.filter((p) => { var _a, _b; return !isTrackOff((_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.state); })
.map((p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: p.user_name || 'Guest',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'camera',
});
});
const screens = filteredParticipants
.filter((p) => { var _a, _b; return !isTrackOff((_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.screenVideo) === null || _b === void 0 ? void 0 : _b.state); })
.map((p) => {
var _a, _b, _c, _d, _e, _f;
return ({
active: true,
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.screenVideo) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
sessionId: p.session_id,
displayName: '',
track: (_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.screenVideo) === null || _f === void 0 ? void 0 : _f.persistentTrack,
type: 'screenshare',
});
});
? this.participantIds.map((id) => participants[id]).filter(Boolean)
: Object.values(participants);
const videos = [];
const screens = [];
const peers = new Map();
for (const p of filteredParticipants) {
if (!isTrackOff((_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.state)) {
videos.push(createVideoObject(p));
}
if (!isTrackOff((_d = (_c = p === null || p === void 0 ? void 0 : p.tracks) === null || _c === void 0 ? void 0 : _c.screenVideo) === null || _d === void 0 ? void 0 : _d.state)) {
screens.push(createScreenshareObject(p));
}
peers.set(p.session_id, createPeerObject(p));
}
this.applyTracks([...videos, ...screens]);
const peers = filteredParticipants.map((p) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
return ({
id: p.session_id,
displayName: p.user_name || 'Guest',
video: {
id: (_d = (_c = (_b = (_a = p === null || p === void 0 ? void 0 : p.tracks) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.track) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '',
paused: isTrackOff((_f = (_e = p === null || p === void 0 ? void 0 : p.tracks) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.state),
},
audio: {},
screenshareVideo: {
id: (_k = (_j = (_h = (_g = p === null || p === void 0 ? void 0 : p.tracks) === null || _g === void 0 ? void 0 : _g.screenVideo) === null || _h === void 0 ? void 0 : _h.track) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : '',
paused: isTrackOff((_m = (_l = p === null || p === void 0 ? void 0 : p.tracks) === null || _l === void 0 ? void 0 : _l.screenVideo) === null || _m === void 0 ? void 0 : _m.state),
},
screenshareAudio: {},
});
});
this.vcsApi.setRoomPeers(peers);
this.vcsApi.setRoomPeerDescriptionsById(peers);
}

@@ -306,0 +319,0 @@ setupEventListeners() {

@@ -51,3 +51,3 @@ export type AssetType = 'font' | 'image';

updateImageSources(sources: VCSSources): void;
setRoomPeers(peers: VCSPeer[]): void;
setRoomPeerDescriptionsById(peers: Map<string, VCSPeer>): void;
}

@@ -54,0 +54,0 @@ export interface VCSComposition {

{
"name": "@daily-co/daily-vcs-web",
"description": "This package enables developers to render a VCSComposition inside a given DOM element in the browser.",
"version": "0.0.1-alpha.3",
"version": "0.0.1-alpha.4",
"license": "BSD-2-Clause",

@@ -6,0 +6,0 @@ "main": "dist/index.cjs.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc