Experimental
@aws-cdk/aws-medialive-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
FileLocation Class
A reference to a file MediaLive reads at runtime — for example an input-loss slate image, an avail-blanking image, a burn-in caption font, or a color-correction LUT.
Use the static factory methods to create one from an S3 bucket (which auto-grants the channel role read access) or from a raw URL.
Example
ts
declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;
declare const audio: medialive.EncodeConfiguration;
medialive.OutputGroupConfiguration.hls({
name: 'hls',
destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
outputs: [
{
encodes: [video],
outputName: 'video',
hlsSettings: medialive.HlsSettings.standard({
m3u8Settings: medialive.M3u8Settings.of({
scte35Behavior: medialive.M3u8Scte35Behavior.PASSTHROUGH,
programNum: 1,
}),
}),
},
{
encodes: [audio],
outputName: 'audio',
hlsSettings: medialive.HlsSettings.audioOnly({
audioGroupId: 'program',
audioOnlyImage: medialive.FileLocation.fromBucket(bucket, 'art/cover.png'),
}),
},
],
});
Initializer
ts
new FileLocation()
python
FileLocation()
java
new FileLocation()
csharp
new FileLocation()
go
NewFileLocation()
Methods
fromBucket(bucket: IBucket, key: string): FileLocation // chainable@staticmethod def from_bucket(bucket: IBucket, key: str) -> FileLocationpublic static FileLocation fromBucket(IBucket bucket, String key)public static FileLocation FromBucket(IBucket bucket, string key)func FromBucket(Bucket IBucket, Key *string) FileLocationstatic#Reference a file in an S3 bucket.
Automatically grants the channel role read access.
2 parameters
Parameters
bucketbucketbucketbucketBucket— The S3 bucket containing the file.keykeykeykeyKey— The object key within the bucket (e.g. 'slates/offline.png').
url(url: string, options?: FileLocationOptions): FileLocation // chainable@staticmethod def url(url: str, options: typing.Optional[FileLocationOptions] = None) -> FileLocationpublic static FileLocation url(String url, FileLocationOptions options)public static FileLocation Url(string url, FileLocationOptions? options = null)func Url(Url *string, Options FileLocationOptions) FileLocationstatic#Reference a file by URL (e.g. an `https://` endpoint or an `s3ssl://` path).
2 parameters
Parameters
urlurlurlurlUrl— The URL MediaLive reads the file from.optionsoptionsoptionsoptionsOptions— Optional credentials.