video

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 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

View Source
var VideoType = types.AddType(&types.Type{Name: "cogentcore.org/core/video.Video", IDName: "video", Doc: "Video represents a video playback widget without any controls.\nSee [Player] for a version with controls.", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Embeds: []types.Field{{Name: "WidgetBase"}}, Fields: []types.Field{{Name: "Media", Doc: "Media is the video media."}, {Name: "Rotation", Doc: "degrees of rotation to apply to the video images\n90 = left 90, -90 = right 90"}, {Name: "Stop", Doc: "setting this to true will stop the playing"}, {Name: "frameBuffer"}, {Name: "frameTarg", Doc: "target frame number to be played"}, {Name: "framePlayed", Doc: "actual frame number displayed"}, {Name: "frameStop", Doc: "frame number to stop playing at, if > 0"}}, Instance: &Video{}})

VideoType is the types.Type for Video

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, name ...string) *Video

NewVideo adds a new Video with the given name to the given 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) DirectRenderDraw

func (v *Video) DirectRenderDraw(drw system.Drawer, idx int, flipY bool)

DirectRenderDraw draws the current image to RenderWin drawer

func (*Video) DirectRenderImage

func (v *Video) DirectRenderImage(drw system.Drawer, idx int)

DirectRenderImage uploads the current view frame directly into the drawer

func (*Video) New

func (t *Video) New() tree.Node

New returns a new *Video value

func (*Video) NodeType added in v0.0.10

func (t *Video) NodeType() *types.Type

NodeType returns the *types.Type of Video

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) 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) SetTooltip

func (t *Video) SetTooltip(v string) *Video

SetTooltip sets the [Video.Tooltip]

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