Skip to content

Commit

Permalink
stricter typing on resolution (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmo314 authored Apr 1, 2021
1 parent 4e685b8 commit dfc37fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface VideoConstraints {
};
}

const resolutions = ['qvga', 'vga', 'shd', 'hd', 'fhd', 'qhd'];
const resolutions = ['qvga', 'vga', 'shd', 'hd', 'fhd', 'qhd'] as const;

export const VideoConstraints: VideoConstraints = {
qvga: {
Expand Down Expand Up @@ -105,14 +105,14 @@ export interface Encoding {
}

export interface Constraints extends MediaStreamConstraints {
resolution: string;
resolution: typeof resolutions[number];
codec: string;
simulcast?: boolean;
sendEmptyOnMute?: boolean;
preferredCodecProfile?: string;
}

const defaults = {
const defaults: Constraints = {
resolution: 'hd',
codec: 'vp8',
audio: true,
Expand Down

0 comments on commit dfc37fa

Please sign in to comment.