Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProtocolName ¶
ProtocolName returns a human-readable name for the protocol.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is an LRU cache for rendered media (terminal strings).
type ImageRenderer ¶
type ImageRenderer struct {
// contains filtered or unexported fields
}
func NewImageRenderer ¶
func NewImageRenderer(protocol Protocol, maxWidth, maxHeight int) *ImageRenderer
func (*ImageRenderer) RenderFile ¶
func (r *ImageRenderer) RenderFile(path string) (string, error)
func (*ImageRenderer) RenderImage ¶
func (r *ImageRenderer) RenderImage(img image.Image) (string, error)
type PlaybackState ¶
type PlaybackState int
PlaybackState represents the state of audio/video playback.
const ( PlaybackStopped PlaybackState = iota PlaybackPlaying PlaybackPaused )
type Protocol ¶
type Protocol int
Protocol represents a terminal image rendering protocol.
func DetectProtocol ¶
func DetectProtocol() Protocol
DetectProtocol probes the terminal for image rendering capabilities.
func ResolveProtocol ¶
ResolveProtocol returns the protocol to use based on config and detection.
type VideoPlayer ¶
type VideoPlayer struct {
// contains filtered or unexported fields
}
VideoPlayer launches videos in an external player.
func NewVideoPlayer ¶
func NewVideoPlayer(player string) *VideoPlayer
NewVideoPlayer creates a new video player launcher.
func (*VideoPlayer) Play ¶
func (v *VideoPlayer) Play(filePath string) error
Play launches a video file in the external player.
type VoicePlayer ¶
type VoicePlayer struct {
// contains filtered or unexported fields
}
VoicePlayer handles voice message playback.
func NewVoicePlayer ¶
func NewVoicePlayer(player string) *VoicePlayer
NewVoicePlayer creates a new voice player using the specified player binary.
func (*VoicePlayer) IsPlaying ¶
func (v *VoicePlayer) IsPlaying() bool
IsPlaying returns true if audio is currently playing.
func (*VoicePlayer) Play ¶
func (v *VoicePlayer) Play(filePath string) error
Play starts playing a voice note file.
func (*VoicePlayer) State ¶
func (v *VoicePlayer) State() PlaybackState
State returns the current playback state.