castv2

package module
v0.0.0-...-008cc5a Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 9 Imported by: 0

README

go-castv2

An implementation of the Chromecast CASTV2 protocol in Golang.

Ported from node-castv2 and node-castv2-client

Examples

For examples of how to use it, see https://github.com/AndreasAbdi/driver-go-chromecast/blob/master/device.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindDevices

func FindDevices(timeout time.Duration, devices chan<- *Device)

FindDevices searches the LAN for chromecast devices via mDNS and sends them to a channel.

Types

type Device

type Device struct {
	ReceiverController *controllers.ReceiverController
	MediaController    *controllers.MediaController
	YoutubeController  *controllers.YoutubeController
	// contains filtered or unexported fields
}

Device Object to run basic chromecast commands

func NewDevice

func NewDevice(host net.IP, port int) (Device, error)

NewDevice is constructor for Device struct

func (*Device) GetMediaStatus

func (device *Device) GetMediaStatus(timeout time.Duration) []*media.MediaStatus

GetMediaStatus of current media controller

func (*Device) GetStatus

func (device *Device) GetStatus(timeout time.Duration) *receiver.ReceiverStatus

GetStatus of the device.

func (*Device) Play

func (device *Device) Play()

Play just plays.

func (*Device) PlayMedia

func (device *Device) PlayMedia(URL string, MIMEType string)

PlayMedia plays a video via the media controller.

func (*Device) PlayMediaFixDuration

func (device *Device) PlayMediaFixDuration(URL string, MIMEType string, duration time.Duration)

PlayMediaFixDuration plays a video via the media controller.

func (*Device) PlayYoutubeVideo

func (device *Device) PlayYoutubeVideo(videoID string)

PlayYoutubeVideo launches the youtube app and tries to play the video based on its id.

func (*Device) QuitApplication

func (device *Device) QuitApplication(timeout time.Duration)

QuitApplication that is currently running on the device

Directories

Path Synopsis
Package api is a generated protocol buffer package.
Package api is a generated protocol buffer package.
examples

Jump to

Keyboard shortcuts

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