play

package
v0.0.0-...-5d9d701 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 27 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package play provides protocol-specific media play (subscribe) clients for integration testing. Each protocol implements the Player interface, which connects to a server, reads media frames, and delivers them to a FrameCallback for analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrameCallback

type FrameCallback func(frame *avframe.AVFrame)

FrameCallback is called for each received media frame.

type PlayConfig

type PlayConfig struct {
	Protocol string        // e.g. "rtmp", "rtsp", "srt", "whep"
	URL      string        // e.g. "rtmp://127.0.0.1:1935/live/test"
	Duration time.Duration // maximum play duration; 0 = until server closes
	Token    string        // optional auth token
}

PlayConfig describes the target and constraints for a play session.

type Player

type Player interface {
	Play(ctx context.Context, cfg PlayConfig, onFrame FrameCallback) error
}

Player subscribes to a media stream and delivers frames via a callback.

func NewPlayer

func NewPlayer(protocol string) (Player, error)

NewPlayer returns a Player for the given protocol. Supported protocols: "rtmp", "rtsp", "srt", "whep", "httpflv", "wsflv", "hls", "llhls", "dash".

Jump to

Keyboard shortcuts

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