Documentation
¶
Overview ¶
Video plays video in native UI, as a launcher's store page does: a short GIF loops behind the window's content, and a trailer with sound plays over it, with controls to pause it, seek and mute it.
go run ./backend/examples/video
The GIF decodes in Go (ui.NewGIFDecoder), on every system: its frames decode on a goroutine a few ahead, and each reaches the screen as it comes due, so the window draws one frame for each of the clip's and none between. It stands still while the window is out of sight, and shows its first frame while the desktop asks for less motion.
The trailer, an MP4 of H.264 and AAC embedded in the app, plays with the system's media framework (package ui/video): AVFoundation on macOS, Media Foundation on Windows, GStreamer on Linux and the video element in browsers, which decode it in hardware where they can and play its sound in sync. Its pictures reach the window's renderer where the decoder left them, on the GPU.