Experimental
@aws-cdk/aws-mediapackagev2-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
CmafSegmentProps Struct
Properties for CMAF segment configuration.
| Stability | Experimental |
|---|---|
| Source | lib/endpoint.ts |
Example
ts
declare const channel: Channel;
declare const spekeRole: iam.IRole;
new OriginEndpoint(this, 'Endpoint', {
channel,
segment: Segment.cmaf({
encryption: CmafEncryption.speke({
method: CmafEncryptionMethod.CBCS,
drmSystems: [CmafDrmSystem.FAIRPLAY, CmafDrmSystem.WIDEVINE],
resourceId: 'my-content-id',
url: 'https://example.com/speke',
role: spekeRole,
keyRotationInterval: Duration.seconds(300),
audioPreset: PresetSpeke20Audio.PRESET_AUDIO_2,
videoPreset: PresetSpeke20Video.PRESET_VIDEO_2,
}),
}),
manifests: [Manifest.hls({ manifestName: 'index' })],
});
python
# channel: Channel
# speke_role: iam.IRole
OriginEndpoint(self, "Endpoint",
channel=channel,
segment=Segment.cmaf(
encryption=CmafEncryption.speke(
method=CmafEncryptionMethod.CBCS,
drm_systems=[CmafDrmSystem.FAIRPLAY, CmafDrmSystem.WIDEVINE],
resource_id="my-content-id",
url="https://example.com/speke",
role=speke_role,
key_rotation_interval=Duration.seconds(300),
audio_preset=PresetSpeke20Audio.PRESET_AUDIO_2,
video_preset=PresetSpeke20Video.PRESET_VIDEO_2
)
),
manifests=[Manifest.hls(manifest_name="index")]
)
java
Channel channel;
IRole spekeRole;
OriginEndpoint.Builder.create(this, "Endpoint")
.channel(channel)
.segment(Segment.cmaf(CmafSegmentProps.builder()
.encryption(CmafEncryption.speke(CmafSpekeEncryptionProps.builder()
.method(CmafEncryptionMethod.CBCS)
.drmSystems(List.of(CmafDrmSystem.FAIRPLAY, CmafDrmSystem.WIDEVINE))
.resourceId("my-content-id")
.url("https://example.com/speke")
.role(spekeRole)
.keyRotationInterval(Duration.seconds(300))
.audioPreset(PresetSpeke20Audio.PRESET_AUDIO_2)
.videoPreset(PresetSpeke20Video.PRESET_VIDEO_2)
.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, "Endpoint", new OriginEndpointProps {
Channel = channel,
Segment = Segment.Cmaf(new CmafSegmentProps {
Encryption = CmafEncryption.Speke(new CmafSpekeEncryptionProps {
Method = CmafEncryptionMethod.CBCS,
DrmSystems = new [] { CmafDrmSystem.FAIRPLAY, CmafDrmSystem.WIDEVINE },
ResourceId = "my-content-id",
Url = "https://example.com/speke",
Role = spekeRole,
KeyRotationInterval = Duration.Seconds(300),
AudioPreset = PresetSpeke20Audio.PRESET_AUDIO_2,
VideoPreset = PresetSpeke20Video.PRESET_VIDEO_2
})
}),
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("Endpoint"), &OriginEndpointProps{
Channel: Channel,
Segment: awsmediapackagev2alpha.Segment_Cmaf(&CmafSegmentProps{
Encryption: awsmediapackagev2alpha.CmafEncryption_Speke(&CmafSpekeEncryptionProps{
Method: awsmediapackagev2alpha.CmafEncryptionMethod_CBCS,
DrmSystems: []CmafDrmSystem{
awsmediapackagev2alpha.CmafDrmSystem_FAIRPLAY,
awsmediapackagev2alpha.CmafDrmSystem_WIDEVINE,
},
ResourceId: jsii.String("my-content-id"),
Url: jsii.String("https://example.com/speke"),
Role: spekeRole,
KeyRotationInterval: awscdk.Duration_Seconds(jsii.Number(300)),
AudioPreset: awsmediapackagev2alpha.PresetSpeke20Audio_PRESET_AUDIO_2,
VideoPreset: awsmediapackagev2alpha.PresetSpeke20Video_PRESET_VIDEO_2,
}),
}),
Manifests: []Manifest{
awsmediapackagev2alpha.Manifest_Hls(&HlsManifestConfiguration{
ManifestName: jsii.String("index"),
}),
},
})
Properties
durationoptionalDurationdurationoptionalDurationdurationoptionalDurationDurationoptionalDurationDurationoptionalDuration = Duration.seconds(6) #Duration of each segment.
encryptionoptionalCmafEncryptionencryptionoptionalCmafEncryptionencryptionoptionalCmafEncryptionEncryptionoptionalCmafEncryptionEncryptionoptionalCmafEncryption #Encryption configuration for the CMAF segment.
Default: No encryption
Use CmafEncryption.speke() to create the configuration.
includeIframeOnlyStreamsoptionalbooleaninclude_iframe_only_streamsoptionalboolincludeIframeOnlyStreamsoptionalBooleanIncludeIframeOnlyStreamsoptionalboolIncludeIframeOnlyStreamsoptional*bool = false #Whether to include I-frame-only streams.
nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string = 'segment' #Name of the segment.
scteFilteroptionalScteMessageType[]scte_filteroptionaltyping.List[ScteMessageType]scteFilteroptionalList<ScteMessageType>ScteFilteroptionalScteMessageType[]ScteFilteroptional*[]ScteMessageType #SCTE-35 message types to treat as ad markers.
Default: no filtering
scteInSegmentsoptionalScteInSegmentsscte_in_segmentsoptionalScteInSegmentsscteInSegmentsoptionalScteInSegmentsScteInSegmentsoptionalScteInSegmentsScteInSegmentsoptionalScteInSegments #Controls whether SCTE-35 messages are included in segment files.
Default: SCTE-35 messages are not included in segments