Skip to content
v2.274.0

Experimental

@aws-cdk/aws-medialive-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

InputPreference Class ​

Input preference when deciding which input to make active after a previously failed input has recovered.

Example ​

ts
declare const stack: Stack;
declare const primaryInput: medialive.IInput;
declare const secondaryInput: medialive.IInput;
declare const audioSelector: medialive.AudioSelector;
declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;
declare const bucket: s3.IBucket;

new medialive.Channel(stack, 'Channel', {
  inputs: [{
    input: primaryInput,
    automaticInputFailover: {
      secondaryInput,
      inputPreference: medialive.InputPreference.PRIMARY_INPUT_PREFERRED,
      errorClearTime: Duration.seconds(3),
      failoverConditions: [
        medialive.FailoverCondition.inputLoss({ threshold: Duration.millis(1500) }),
        medialive.FailoverCondition.audioSilence({ audioSelector, threshold: Duration.seconds(2) }),
        medialive.FailoverCondition.videoBlack({ blackDetectThreshold: 0.1, threshold: Duration.seconds(1) }),
      ],
    },
  }, {
    // The secondary input must also be attached to the channel as its own input.
    input: secondaryInput,
  }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video, audio], outputName: 'hls_out' }],
    }),
  ],
});

Properties ​

EQUAL_INPUT_PREFERENCEInputPreferenceequal_input_preferenceInputPreferenceEQUAL_INPUT_PREFERENCEInputPreferenceEQUAL_INPUT_PREFERENCEInputPreferenceEQUAL_INPUT_PREFERENCEInputPreferencerequiredstatic#
No preference — stay on the currently active input even after the other recovers.
PRIMARY_INPUT_PREFERREDInputPreferenceprimary_input_preferredInputPreferencePRIMARY_INPUT_PREFERREDInputPreferencePRIMARY_INPUT_PREFERREDInputPreferencePRIMARY_INPUT_PREFERREDInputPreferencerequiredstatic#
Prefer the primary input — switch back to it once it has been free of failover conditions for the error-clear time.
valuestringvaluestrvalueStringValuestringValue*stringrequired#
The underlying string value passed to CloudFormation.

Methods ​

of(value: string): InputPreference // chainable@staticmethod def of(value: str) -> InputPreferencepublic static InputPreference of(String value)public static InputPreference Of(string value)func Of(Value *string) InputPreferencestatic#
A value not yet modelled by AWS CDK.