Skip to content
Go bindings for AirPlay client
Branch: master
Clone or download
Pull request Compare This branch is even with karthikpanicker:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
.gitignore
.travis.yml
LICENSE.txt
README.md
client.go
client_test.go
connection.go
device.go
discovery.go
discovery_test.go
errors.go

README.md

go-airplay

GoDoc Build Status Coverage Status

Go bindings for AirPlay client. Fork from gongo/go-airplay. For discovery a network interface can be provided to the discovery service.

Usage

Videos

import "github.com/gongo/go-airplay"

client, err := airplay.FirstClient()
if err != nil {
	log.Fatal(err)
}

ch := client.Play("http://movie.example.com/go.mp4")

// Block until have played content to the end
<-ch

If device is required password:

client.SetPassword("password")

Specifying the start position:

// Start from 42% of length of content.
client.PlayAt("http://movie.example.com/go.mp4", 0.42)

Other API:

// Seek to 120 seconds from start position.
client.Scrub(120.0)

// Change playback rate
client.Rate(0.0) // pause
client.Rate(1.0) // resume

See:

Images

// local file
client.Photo("/path/to/gopher.jpg")

// remote file
client.Photo("http://blog.golang.org/gopher/plush.jpg")

You can specify the transition want to slide:

client.Photo("/path/to/gopher.jpg", airplay.SlideNone) // eq client.Photo("..")
client.Photo("/path/to/gopher.jpg", airplay.SlideDissolve)
client.Photo("/path/to/gopher.jpg", airplay.SlideRight)
client.Photo("/path/to/gopher.jpg", airplay.SlideLeft)

See example/slideshow :

Devices

// Get all AirPlay devices in LAN.
devices := airplay.Devices()

// Get the first found AirPlay device in LAN.
device := airplay.FirstDevice()

See example/devices :

LICENSE

MIT License.

You can’t perform that action at this time.