open-standards/wai/examples/apple-app
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science e8c8327631 wai/examples: every template Apache-2.0, its LICENSE carried into the project
Each example holds the license's text as LICENSE (wai/LICENSE, byte for byte) and says so in
its README; wai create writes it with the rest of the template, from one copy in the binary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 04:52:31 -04:00
..
Sources/WaiApp wai: the developer's path, hello, create, dev and verify, a floor build with no system library, and nine examples 2026-10-26 22:58:39 -04:00
test wai: the developer's path, hello, create, dev and verify, a floor build with no system library, and nine examples 2026-10-26 22:58:39 -04:00
.gitignore wai: the developer's path, hello, create, dev and verify, a floor build with no system library, and nine examples 2026-10-26 22:58:39 -04:00
LICENSE wai/examples: every template Apache-2.0, its LICENSE carried into the project 2026-10-27 04:52:31 -04:00
Package.swift wai: the developer's path, hello, create, dev and verify, a floor build with no system library, and nine examples 2026-10-26 22:58:39 -04:00
README.md wai/examples: every template Apache-2.0, its LICENSE carried into the project 2026-10-27 04:52:31 -04:00
sample-session.json wai: the developer's path, hello, create, dev and verify, a floor build with no system library, and nine examples 2026-10-26 22:58:39 -04:00
wai.json wai: the developer's path, hello, create, dev and verify, a floor build with no system library, and nine examples 2026-10-26 22:58:39 -04:00

A native app on Apple platforms

What it shows. The WAI native sink in a SwiftUI app. The platform's player plays as it always does; the sink sits on the path of its requests, verifies each playlist against its receipt and each object against the hash its name states, withholds what does not verify, signs an acknowledgement of what was received, and at the end signs a bundle the stream's owner verifies. --replay runs a recorded playback session through the same sink with no window, and checks the bundle.

Run it. The sink is the wai-sink-swift package of the WAI repository; build it once (macOS with Xcode), then point this project at it:

wai create my-app --template apple-app
cd <your clone>/wai/wai-sink-swift && WAI_SINK_SLICES=macos scripts/build-xcframework.sh
cd my-app
export WAI_SINK_SWIFT=<your clone>/wai/wai-sink-swift
swift run WaiApp --replay sample-session.json
swift run WaiApp

What you see. The replay prints how many playlists and objects went through the sink and that the bundle verifies. The player opens a window: give it an HLS address (the package-and-deliver example's, under wai dev, by default) and press Play.

Make it yours. PlayerApp.swift is the whole integration: a WaiSink.Config, a WaiPlayerSession, and its player in a VideoPlayer. For a stream its owner seals, set requireSigned: true, and nothing the owner did not sign reaches the decoder.

With a coding assistant. Run wai setup-agent in this directory: it writes the instructions an assistant reads and connects it to WAI's tools.

License. Apache-2.0: the text is in LICENSE, and a project wai create makes from this example carries it.