video-player

command
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 11 Imported by: 0

README

Video Player

Plays video files on an HTML canvas — frames are decoded in Go via ffmpeg, sent to the browser, and painted on a <canvas> element. No <video> tag involved.

Requirements

  • ffmpeg installed and in your PATH

Usage

go run ./examples/video-player/ -video /path/to/video.mp4

With godom env vars:

GODOM_PORT=8099 GODOM_NO_AUTH=1 go run ./examples/video-player/ -video /path/to/video.mp4

Controls

  • Play / Pause — toggle playback
  • Stop — reset to first frame
  • -5s / +5s — skip backward or forward

How it works

  1. Go shells out to ffmpeg to decode the video into JPEG frames at 24fps
  2. Frames are stored in memory and base64-encoded as plugin data
  3. The JS plugin (20 lines) decodes each JPEG and draws it on canvas via drawImage
  4. All playback logic (play/pause/stop/seek) lives entirely in Go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL