Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@types/react": "^16.9.19",
"@types/react-dom": "^16.9.5",
"@types/react-router-dom": "^5.1.3",
"@types/twilio-video": "^2.7.0",
"concurrently": "^5.1.0",
"cross-env": "^7.0.2",
"d3-timer": "^1.0.10",
Expand All @@ -32,7 +31,7 @@
"react-scripts": "^3.4.4",
"strip-color": "^0.1.0",
"twilio": "^3.39.3",
"twilio-video": "^2.9.0",
"twilio-video": "^2.11.0",
"typescript": "^3.8.3"
},
"devDependencies": {
Expand Down
23 changes: 1 addition & 22 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,12 @@ import { LocalVideoTrack, RemoteVideoTrack, TwilioError } from 'twilio-video';
import { EventEmitter } from 'events';

declare module 'twilio-video' {
interface LocalParticipant {
setBandwidthProfile: (bandwidthProfile: BandwidthProfileOptions) => void;
publishTrack(track: LocalTrack, options?: { priority: Track.Priority }): Promise<LocalTrackPublication>;
}

interface VideoCodecSettings {
simulcast?: boolean;
}

interface LocalTrackPublication {
setPriority: (priority: Track.Priority) => void;
}

// These help to create union types between Local and Remote VideoTracks
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add this in the sdk that way we can get rid of this declaration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. I'm leaning towards no. This declaration is added because we are creating a union type with LocalVideoTracks and RemoteVideoTracks. Not every application developer may want to do this, so I don't think it needs to be added to the SDK. We aren't adding it here because of a flaw in the SDK types.

Plus, it isn't taking much space here in types.js. I'm not in a hurry to get rid of it 🙂

interface LocalVideoTrack {
isSwitchedOff: undefined;
setPriority: undefined;
}

interface RemoteVideoTrack {
isSwitchedOff: boolean;
setPriority: (priority: Track.Priority | null) => void;
}

interface VideoBandwidthProfileOptions {
trackSwitchOffMode?: 'predicted' | 'detected' | 'disabled';
}

function testPreflight(
subscriberToken: string,
publisherToken: string,
Expand Down