Channel
Source:
src/AWS/MediaPackageV2/Channel.ts
An AWS Elemental MediaPackage v2 channel — the entry point for live content into MediaPackage. An encoder (such as AWS Elemental MediaLive) pushes an HLS or CMAF stream to the channel’s ingest endpoints; origin endpoints then package and serve that content downstream.
Creating a Channel
Section titled “Creating a Channel”Basic Channel in a Group
import * as MediaPackageV2 from "alchemy/AWS/MediaPackageV2";
const group = yield* MediaPackageV2.ChannelGroup("Live");const channel = yield* MediaPackageV2.Channel("Feed", { channelGroupName: group.channelGroupName,});CMAF Ingest Channel
const channel = yield* MediaPackageV2.Channel("Feed", { channelGroupName: group.channelGroupName, inputType: "CMAF", description: "CMAF contribution feed",});Resource Policy
Section titled “Resource Policy”const channel = yield* MediaPackageV2.Channel("Feed", { channelGroupName: group.channelGroupName, policy: JSON.stringify({ Version: "2012-10-17", Statement: [{ Effect: "Allow", Principal: { AWS: "arn:aws:iam::111122223333:root" }, Action: "mediapackagev2:PutObject", Resource: "arn:aws:mediapackagev2:us-east-1:111122223333:channelGroup/live/channel/feed", }], }),});Ingest Endpoints
Section titled “Ingest Endpoints”const channel = yield* MediaPackageV2.Channel("Feed", { channelGroupName: group.channelGroupName,});// Two redundant ingest endpoints for the encoder to push to.const urls = channel.ingestEndpoints;