Documentation ¶
Overview ¶
Package video implements a video player widget in Cogent Core.
Index ¶
- Constants
- Variables
- type Video
- func (v *Video) Destroy()
- func (v *Video) DirectRenderDraw(drw system.Drawer, idx int, flipY bool)
- func (v *Video) DirectRenderImage(drw system.Drawer, idx int)
- func (t *Video) New() tree.Node
- func (t *Video) NodeType() *types.Type
- 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 (t *Video) SetMedia(v *reisen.Media) *Video
- func (t *Video) SetRotation(v float32) *Video
- func (t *Video) SetStop(v bool) *Video
- func (t *Video) SetTooltip(v string) *Video
- func (v *Video) StreamSamples(sampleSource <-chan [2]float64) beep.Streamer
Constants ¶
const (
SpeakerSampleRate beep.SampleRate = 44100
)
Variables ¶
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 ¶
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) DirectRenderDraw ¶
DirectRenderDraw draws the current image to RenderWin drawer
func (*Video) DirectRenderImage ¶
DirectRenderImage uploads the current view frame directly into the drawer
func (*Video) NodeType ¶ added in v0.0.10
NodeType returns the *types.Type of Video
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) 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) SetTooltip ¶
SetTooltip sets the [Video.Tooltip]
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.