Bitrate Class
Represents a bitrate value.
The amount can be specified either as a literal value (e.g: 10) which cannot be negative, or as an unresolved number token.
When the amount is passed as a token, unit conversion is not possible.
Example
ts
declare const stack: Stack;
declare const networkInterface: RouterNetworkInterface;
const input = new RouterInput(stack, 'FailoverInput', {
routerInputName: 'failover-input',
maximumBitrate: Bitrate.mbps(10),
routingScope: RoutingScope.REGIONAL,
tier: RouterInputTier.INPUT_20,
configuration: RouterInputConfiguration.failover({
networkInterface: networkInterface,
protocols: [
RouterInputProtocol.rist({
port: 5000,
recoveryLatency: Duration.millis(1000),
}),
RouterInputProtocol.rist({
port: 5002, // Must not be consecutive with primary port
recoveryLatency: Duration.millis(1000),
}),
],
sourcePriority: SourcePriorityConfig.primarySecondary(PrimarySource.FIRST_SOURCE),
}),
});
Methods
bps(amount: number): Bitrate // chainable@staticmethod def bps(amount: int | float) -> Bitratepublic static Bitrate bps(Number amount)public static Bitrate Bps(double amount)func Bps(Amount *float64) Bitratestatic#Create a Bitrate representing an amount of bits per second.
1 parameter
Parameters
amountamountamountamountAmount— the amount of bits per second.
gbps(amount: number): Bitrate // chainable@staticmethod def gbps(amount: int | float) -> Bitratepublic static Bitrate gbps(Number amount)public static Bitrate Gbps(double amount)func Gbps(Amount *float64) Bitratestatic#Create a Bitrate representing an amount of gigabits per second.
1 parameter
Parameters
amountamountamountamountAmount— the amount of gigabits per second.
isUnresolved(): booleandef is_unresolved(self, ) -> boolpublic Boolean isUnresolved()public bool IsUnresolved()func IsUnresolved() *bool#Checks if bitrate is a token or a resolvable object.
kbps(amount: number): Bitrate // chainable@staticmethod def kbps(amount: int | float) -> Bitratepublic static Bitrate kbps(Number amount)public static Bitrate Kbps(double amount)func Kbps(Amount *float64) Bitratestatic#Create a Bitrate representing an amount of kilobits per second.
1 parameter
Parameters
amountamountamountamountAmount— the amount of kilobits per second.
mbps(amount: number): Bitrate // chainable@staticmethod def mbps(amount: int | float) -> Bitratepublic static Bitrate mbps(Number amount)public static Bitrate Mbps(double amount)func Mbps(Amount *float64) Bitratestatic#Create a Bitrate representing an amount of megabits per second.
1 parameter
Parameters
amountamountamountamountAmount— the amount of megabits per second.
toBps(): numberdef to_bps(self, ) -> int | floatpublic Number toBps()public double ToBps()func ToBps() *float64#Return the total number of bits per second.
toGbps(): numberdef to_gbps(self, ) -> int | floatpublic Number toGbps()public double ToGbps()func ToGbps() *float64#Return the total number of gigabits per second.
toKbps(): numberdef to_kbps(self, ) -> int | floatpublic Number toKbps()public double ToKbps()func ToKbps() *float64#Return the total number of kilobits per second.
toMbps(): numberdef to_mbps(self, ) -> int | floatpublic Number toMbps()public double ToMbps()func ToMbps() *float64#Return the total number of megabits per second.