import type { Eq , PartialOrd } from '../utils/Types' ; import TargetDisplaySize from './TargetDisplaySize' ; export default class VideoPreference implements Eq , PartialOrd { /**
     * The desired maximum simulcast layers to receive.
     */ targetSize : TargetDisplaySize ; param attendeeId param priority param targetSize constructor ( public attendeeId , public priority , targetSize ? ) { this . targetSize = targetSize !== undefined ? targetSize : TargetDisplaySize . High ; } partialCompare ( other ) { return this . priority - other . priority ; } equals ( other ) { return ( this . attendeeId === other . attendeeId && this . targetSize === other . targetSize && this . priority === other . priority ) ; } private static readonly LOW_BITRATE_KBPS = 300 ; private static readonly MID_BITRATE_KBPS = 600 ; private static readonly HIGH_BITRATE_KBPS = 1200 ; targetSizeToBitrateKbps ( targetSize ) { switch ( targetSize ) { case TargetDisplaySize . High : return VideoPreference . HIGH_BITRATE_KBPS ; case TargetDisplaySize . Medium : return VideoPreference . MID_BITRATE_KBPS ; case TargetDisplaySize . Low : return VideoPreference . LOW_BITRATE_KBPS ; } } }