Stream
Source:
src/AWS/KinesisVideo/Stream.ts
An Amazon Kinesis Video Stream for ingesting, storing, and consuming live video.
Stream creation is asynchronous — the provider waits (bounded) for the
stream to become ACTIVE before returning. deviceName and mediaType
are updated in place; dataRetention converges via UpdateDataRetention;
changing streamName or kmsKeyId replaces the stream.
Creating Streams
Section titled “Creating Streams”Basic Video Stream
import * as AWS from "alchemy/AWS";
const stream = yield* AWS.KinesisVideo.Stream("Camera");Stream with Retention and Media Type
const stream = yield* AWS.KinesisVideo.Stream("Camera", { mediaType: "video/h264", dataRetention: "24 hours", tags: { Environment: "production" },});Reading Media
Section titled “Reading Media”Bind data-plane read operations in the init phase and use them in
runtime handlers. The bindings resolve the per-stream data endpoint
(GetDataEndpoint) automatically.
HLS Playback URL
// initconst getHls = yield* AWS.KinesisVideo.GetHLSStreamingSessionURL(stream);
// runtimeconst { HLSStreamingSessionURL } = yield* getHls({ PlaybackMode: "LIVE" });Raw Media
// initconst getMedia = yield* AWS.KinesisVideo.GetMedia(stream);
// runtimeconst media = yield* getMedia({ StartSelector: { StartSelectorType: "EARLIEST" },});