Discover Packages
github.com/anupshinde/godom
examples
video-player
command
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Jun 28, 2026
License: MIT
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
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
Go shells out to ffmpeg to decode the video into JPEG frames at 24fps
Frames are stored in memory and base64-encoded as plugin data
The JS plugin (20 lines) decodes each JPEG and draws it on canvas via drawImage
All playback logic (play/pause/stop/seek) lives entirely in Go
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.