Giter VIP home page Giter VIP logo

go-airplay's Introduction

go-airplay

GoDoc Build Status Coverage Status

Go bindings for AirPlay client

Usage

Videos

import "github.com/kylegrantlucas/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.

go-airplay's People

Contributors

gongo avatar tomohiro avatar kylegrantlucas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.