Documentation
¶
Overview ¶
Package video implements a video player widget in Cogent Core.
Index ¶
- Constants
- type Video
- func (v *Video) Destroy()
- func (v *Video) OnAdd()
- func (v *Video) Open(fpath string) error
- func (v *Video) Play(width, height float32) error
- func (v *Video) ReadVideoAndAudio() (<-chan *image.RGBA, <-chan [2]float64, chan error, error)
- func (v *Video) RenderDraw(drw system.Drawer, op draw.Op)
- func (t *Video) SetMedia(v *reisen.Media) *Video
- func (t *Video) SetRotation(v float32) *Video
- func (t *Video) SetStop(v bool) *Video
- func (v *Video) StreamSamples(sampleSource <-chan [2]float64) beep.Streamer
Constants ¶
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 ¶
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) Play ¶
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 ¶
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
RenderDraw draws the current image to RenderWindow drawer
func (*Video) SetRotation ¶ added in v0.0.10
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
SetStop sets the [Video.Stop]: setting this to true will stop the playing
func (*Video) StreamSamples ¶
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.