media-operator
media-operator plays films, series, and music on the screens and
speakers of a liken
cluster, and lets a
remote control them. You declare each unit of equipment, such as a
TV with its speakers, as a Player, and you start playback by
creating a Play on it. A Remote connects a controller to the
players it drives.
Things you can run this way:
- a film on a TV with a surround pair, the picture on the TV and the sound on the speakers,
- an album on a lone speaker,
- a season of episodes, played in order to the end,
- any
https://stream,nfs://export,claim://volume in thePlay’s namespace, or apattern://test pattern that the player image carries.
Start here:
- Install the operator
. The install applies
the manifests that this site serves at
/deploy/, so you don’t need a clone. - Declare a
Playerfor a screen and its speakers, and prove that it plays. - Map a new controller when its buttons do the wrong thing.
- Reference : each resource, its fields, and its topics on the message bus.
How it works
The API has five resources:
- A
Playeris one unit of equipment in one place: a lone speaker, a TV with its own speakers, or a TV with a receiver. It selects its screen, speakers, and GPU with the same CEL selectors that a hand-writtenResourceClaimuses. - A
Playis one run of media on a player, like aJob: a film, an album, or a season. Create it to start, delete it to stop, andkubectl get playslists what’s playing now. - A
Remoteis one physical controller, bound to the players it drives. - A
Keymapmaps one controller model’s buttons to media actions. MediaPreferencesholds the cluster’s default audio and subtitle languages.
For each Play, the operator starts one pod that runs
mpv
, with claims on the Player’s devices. It
claims the speakers and the other devices only while the Play runs,
so other workloads can use them in between. Between plays, each
Player’s idle pod keeps the screen: it shows a clock and the
player’s name, and fades them after a few minutes with no activity.
You can also have the operator turn the panel off after longer, when
display-operator serves the screen.
Each Remote has its own pod, which sends button presses to the
cluster’s message bus
, and the playback pod
acts on them. Your own programs can use the same bus. The operator
also ships a capabilities agent, which publishes what each GPU can
decode, encode, and scale, as media.liken.sh devices, so a pod can
claim a GPU that decodes 10-bit HEVC, for example.
media-operator is one of the extension operators for
running a home theater
.
It plays what you name in a Play.
library-operator
adds a catalog of
your films and series, and a browser on the screen to pick from it.