video

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: BSD-3-Clause Imports: 12 Imported by: 0

README

video

A video player component for the Cogent Core GUI framework

Documentation

Overview

Package video implements a video player widget in Cogent Core.

Index

Constants

View Source
const (
	SpeakerSampleRate beep.SampleRate = 44100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Video

type Video struct {
	core.WidgetBase

	// Media is the video media.
	Media *reisen.Media

	// degrees of rotation to apply to the video images
	// 90 = left 90, -90 = right 90
	Rotation float32

	// setting this to true will stop the playing
	Stop bool
	// contains filtered or unexported fields
}

Video represents a video playback widget without any controls. See [Player] for a version with controls.

func NewVideo

func NewVideo(parent ...tree.Node) *Video

NewVideo returns a new Video with the given optional parent: Video represents a video playback widget without any controls. See [Player] for a version with controls.

func (*Video) Destroy

func (v *Video) Destroy()

func (*Video) OnAdd

func (v *Video) OnAdd()

func (*Video) Open

func (v *Video) Open(fpath string) error

Open opens the video specified by the given filepath.

func (*Video) Play

func (v *Video) Play(width, height float32) error

Play starts playing the video at the specified size. Values of 0 indicate to use the inherent size of the video for that dimension.

func (*Video) ReadVideoAndAudio

func (v *Video) ReadVideoAndAudio() (<-chan *image.RGBA, <-chan [2]float64, chan error, error)

ReadVideoAndAudio reads video and audio frames from the opened media and sends the decoded data to che channels to be played.

func (*Video) RenderDraw added in v0.3.2

func (v *Video) RenderDraw(drw system.Drawer, op draw.Op)

RenderDraw draws the current image to RenderWindow drawer

func (*Video) SetMedia

func (t *Video) SetMedia(v *reisen.Media) *Video

SetMedia sets the [Video.Media]: Media is the video media.

func (*Video) SetRotation added in v0.0.10

func (t *Video) SetRotation(v float32) *Video

SetRotation sets the [Video.Rotation]: degrees of rotation to apply to the video images 90 = left 90, -90 = right 90

func (*Video) SetStop added in v0.0.10

func (t *Video) SetStop(v bool) *Video

SetStop sets the [Video.Stop]: setting this to true will stop the playing

func (*Video) StreamSamples

func (v *Video) StreamSamples(sampleSource <-chan [2]float64) beep.Streamer

StreamSamples creates a new custom streamer for playing audio samples provided by the source channel.

See https://github.com/faiface/beep/wiki/Making-own-streamers for reference.

Jump to

Keyboard shortcuts

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