Skip to content
v2.277.0

Experimental

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

SegmentConfiguration Struct ​

The segment configuration, including the segment name, duration, and other configuration values.

Example ​

ts
declare const channel: Channel;
declare const spekeRole: iam.IRole;

new OriginEndpoint(this, 'TsEndpoint', {
  channel,
  segment: Segment.ts({
    encryption: TsEncryption.speke({
      method: TsEncryptionMethod.SAMPLE_AES,
      resourceId: 'my-content-id',
      url: 'https://example.com/speke',
      role: spekeRole,
    }),
  }),
  manifests: [Manifest.hls({ manifestName: 'index' })],
});
python
# channel: Channel
# speke_role: iam.IRole


OriginEndpoint(self, "TsEndpoint",
    channel=channel,
    segment=Segment.ts(
        encryption=TsEncryption.speke(
            method=TsEncryptionMethod.SAMPLE_AES,
            resource_id="my-content-id",
            url="https://example.com/speke",
            role=speke_role
        )
    ),
    manifests=[Manifest.hls(manifest_name="index")]
)
java
Channel channel;
IRole spekeRole;


OriginEndpoint.Builder.create(this, "TsEndpoint")
        .channel(channel)
        .segment(Segment.ts(TsSegmentProps.builder()
                .encryption(TsEncryption.speke(TsSpekeEncryptionProps.builder()
                        .method(TsEncryptionMethod.SAMPLE_AES)
                        .resourceId("my-content-id")
                        .url("https://example.com/speke")
                        .role(spekeRole)
                        .build()))
                .build()))
        .manifests(List.of(Manifest.hls(HlsManifestConfiguration.builder().manifestName("index").build())))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaPackageV2.Alpha
Channel channel;
IRole spekeRole;


new OriginEndpoint(this, "TsEndpoint", new OriginEndpointProps {
    Channel = channel,
    Segment = Segment.Ts(new TsSegmentProps {
        Encryption = TsEncryption.Speke(new TsSpekeEncryptionProps {
            Method = TsEncryptionMethod.SAMPLE_AES,
            ResourceId = "my-content-id",
            Url = "https://example.com/speke",
            Role = spekeRole
        })
    }),
    Manifests = new [] { Manifest.Hls(new HlsManifestConfiguration { ManifestName = "index" }) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2
var channel Channel
var spekeRole IRole


awsmediapackagev2alpha.NewOriginEndpoint(this, jsii.String("TsEndpoint"), &OriginEndpointProps{
	Channel: Channel,
	Segment: awsmediapackagev2alpha.Segment_Ts(&TsSegmentProps{
		Encryption: awsmediapackagev2alpha.TsEncryption_Speke(&TsSpekeEncryptionProps{
			Method: awsmediapackagev2alpha.TsEncryptionMethod_SAMPLE_AES,
			ResourceId: jsii.String("my-content-id"),
			Url: jsii.String("https://example.com/speke"),
			Role: spekeRole,
		}),
	}),
	Manifests: []Manifest{
		awsmediapackagev2alpha.Manifest_Hls(&HlsManifestConfiguration{
			ManifestName: jsii.String("index"),
		}),
	},
})

Properties ​

containerTypeContainerTypecontainer_typeContainerTypecontainerTypeContainerTypeContainerTypeContainerTypeContainerTypeContainerType required #
The container type for this segment (TS or CMAF).
encryptionoptionalEncryptionConfigurationencryptionoptionalEncryptionConfigurationencryptionoptionalEncryptionConfigurationEncryptionoptionalEncryptionConfigurationEncryptionoptionalEncryptionConfiguration #
Encryption configuration for the segment.

Default: No encryption

includeIframeOnlyStreamsoptionalbooleaninclude_iframe_only_streamsoptionalboolincludeIframeOnlyStreamsoptionalBooleanIncludeIframeOnlyStreamsoptionalboolIncludeIframeOnlyStreamsoptional*bool #
Whether the segment includes I-frame-only streams.

Default: undefined - Not specified.

scteFilteroptionalScteMessageType[]scte_filteroptionaltyping.List[ScteMessageType]scteFilteroptionalList<ScteMessageType>ScteFilteroptionalScteMessageType[]ScteFilteroptional*[]ScteMessageType #
The SCTE-35 configuration associated with the segment.

Default: No SCTE filtering

The SCTE-35 message types that you want to be treated as ad markers in the output.

scteInSegmentsoptionalScteInSegmentsscte_in_segmentsoptionalScteInSegmentsscteInSegmentsoptionalScteInSegmentsScteInSegmentsoptionalScteInSegmentsScteInSegmentsoptionalScteInSegments #
Controls whether SCTE-35 messages are included in segment files.

Default: SCTE-35 messages are not included in segments

segmentDurationoptionalDurationsegment_durationoptionalDurationsegmentDurationoptionalDurationSegmentDurationoptionalDurationSegmentDurationoptionalDuration = 6 #
The duration of the segments.
segmentNameoptionalstringsegment_nameoptionalstrsegmentNameoptionalStringSegmentNameoptionalstringSegmentNameoptional*string = segment #
The name of the segment associated with the origin endpoint.
tsIncludeDvbSubtitlesoptionalbooleants_include_dvb_subtitlesoptionalbooltsIncludeDvbSubtitlesoptionalBooleanTsIncludeDvbSubtitlesoptionalboolTsIncludeDvbSubtitlesoptional*bool = false #
Whether the segment includes DVB subtitles.
tsUseAudioRenditionGroupoptionalbooleants_use_audio_rendition_groupoptionalbooltsUseAudioRenditionGroupoptionalBooleanTsUseAudioRenditionGroupoptionalboolTsUseAudioRenditionGroupoptional*bool = false #
Whether the segment is an audio rendition group.