Skip to content

OriginEndpoint

Source: src/AWS/MediaPackageV2/OriginEndpoint.ts

An AWS Elemental MediaPackage v2 origin endpoint — the output side of a channel. The endpoint packages the channel’s ingested content into HLS, low-latency HLS, DASH, and/or MSS manifests and serves them to downstream devices (players or CDNs) on the channel group’s egress domain.

HLS Endpoint on a Channel

import * as MediaPackageV2 from "alchemy/AWS/MediaPackageV2";
const group = yield* MediaPackageV2.ChannelGroup("Live");
const channel = yield* MediaPackageV2.Channel("Feed", {
channelGroupName: group.channelGroupName,
});
const endpoint = yield* MediaPackageV2.OriginEndpoint("Playback", {
channelGroupName: group.channelGroupName,
channelName: channel.channelName,
containerType: "TS",
hlsManifests: [{ ManifestName: "index" }],
});

CMAF Endpoint with DASH and Low-Latency HLS

const endpoint = yield* MediaPackageV2.OriginEndpoint("Playback", {
channelGroupName: group.channelGroupName,
channelName: channel.channelName,
containerType: "CMAF",
segment: { SegmentDurationSeconds: 4 },
dashManifests: [{ ManifestName: "dash" }],
lowLatencyHlsManifests: [{ ManifestName: "ll-hls" }],
});
const endpoint = yield* MediaPackageV2.OriginEndpoint("Playback", {
channelGroupName: group.channelGroupName,
channelName: channel.channelName,
containerType: "TS",
startoverWindow: "1 hour",
hlsManifests: [{ ManifestName: "index" }],
});
const endpoint = yield* MediaPackageV2.OriginEndpoint("Playback", {
channelGroupName: group.channelGroupName,
channelName: channel.channelName,
containerType: "TS",
hlsManifests: [{ ManifestName: "index" }],
policy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Effect: "Allow",
Principal: { AWS: "arn:aws:iam::111122223333:root" },
Action: ["mediapackagev2:GetObject", "mediapackagev2:GetHeadObject"],
Resource: "arn:aws:mediapackagev2:us-east-1:111122223333:channelGroup/live/channel/feed/originEndpoint/playback",
}],
}),
});
const playbackUrl = endpoint.hlsManifests.map((m) => m.url);