player

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package player opens remote media in an external video player.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidMediaURL indicates that a player received an unsafe or
	// unsupported media URL.
	ErrInvalidMediaURL = errors.New("invalid media URL")
	// ErrUnsupportedPlatform indicates that IINA cannot run on this operating
	// system.
	ErrUnsupportedPlatform = errors.New("IINA is unsupported on this platform")
)
View Source
var ErrUnavailable = errors.New("video player is unavailable")

ErrUnavailable indicates that no external player is configured yet.

Functions

This section is empty.

Types

type IINA

type IINA struct {
	// contains filtered or unexported fields
}

IINA opens loopback media URLs in the IINA macOS application.

func NewIINA

func NewIINA() *IINA

NewIINA creates an IINA launcher for the current platform.

func (*IINA) Open

func (i *IINA) Open(ctx context.Context, mediaURL *url.URL) error

Open validates the local stream URL and asks macOS to open it in IINA.

type Player

type Player interface {
	Open(context.Context, *url.URL) error
}

Player opens a media URL in an external application.

type Streaming

type Streaming struct {
	// contains filtered or unexported fields
}

Streaming combines an authenticated loopback proxy with an external player.

func NewStreaming

func NewStreaming(proxy *streaming.Proxy, launcher Player) *Streaming

NewStreaming creates a player that proxies remote media before launching it.

func (*Streaming) Close

func (p *Streaming) Close() error

Close stops the active local streaming session.

func (*Streaming) Open

func (p *Streaming) Open(ctx context.Context, source *url.URL) error

Open starts an authenticated local stream and opens its URL in the external player. A previously active stream is closed only after the new launch succeeds.

type Unavailable

type Unavailable struct{}

Unavailable is a placeholder used until a real player is configured.

func (Unavailable) Open

Open reports that no external player is configured.

Jump to

Keyboard shortcuts

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