npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

trampoline

v0.0.1

Published

Apple AirPlay trampoline server

Downloads

5

Readme

Trampoline -- AirPlay control service

Trampoline provides a node server that gives a RESTful API to AirPlay devices on the local network via node-airplay. The server can be used by applications on the local machine or network to discover AirPlay devices and control the playback of those devices with one API.

Eventually, Trampoline will provide transparent video serving (exposing individual local files over HTTP to enable playback from AirPlay devices) and transcoding (sourcing from local or remote video files and transcoding into a format that Apple devices will accept).

Quickstart

npm install trampoline
npm start trampoline

Installation

With npm:

npm install trampoline

From source:

cd ~
git clone https://[email protected]/benvanik/trampoline.git
npm link trampoline/

Configuration

When using npm start, use npm config to change the launch options:

npm config set trampoline:port 8090
npm start trampoline

If launching directly via trampoline:

trampoline --port=8090

API

Content API

NOTE: content status readyToPlay must be true before attempting playback!

Setup a new content serving request:

POST /content/setup
    {
      source: {
        content: string,
        mimeType: string,     // 'video/webm'
        cookie: string,
        referer: string,
        auth: string          // user:password
      },
      target: {
        mimeType: string,     // 'video/mp4'
        resolution: number,   // 480, 720, 1080, undefined for original
        quality: number       // [0-1], undefined for don't care
      }
    }
--> {
      id: string
    }

GET /content/[id]
--> [streaming content]

PUT /content/[id]

DELETE /content/[id]

GET /content/[id]/status
--> {
      cached: boolean,
      seekable: boolean,
      readyToPlay: boolean
    }

POST /content/[id]/cache
    {}
--> {}

Device API

List all devices on the network (query occasionally):

GET /device/list
--> {
      devices: [
        {
          id: string,
          name: string,
          deviceId: string,
          features: number,
          model: string,
          slideshowFeatures: [],
          supportedContentTypes: [string, ...]
        }, ...
      ]
    }

Get the information of a specific device:

GET /device/id/
--> {
      id: string,
      name: string,
      deviceId: string,
      features: number,
      model: string,
      slideshowFeatures: [],
      supportedContentTypes: [string, ...]
    }

Get the playback status of a device:

GET /device/id/status
--> {
      duration: number,
      position: number,
      rate: number,
      playbackBufferEmpty: boolean,
      playbackBufferFull: boolean,
      playbackLikelyToKeepUp: boolean,
      readyToPlay: boolean,
      loadedTimeRanges: [
        {
          start: number,
          duration: number
        }, ...
      ],
      seekableTimeRanges: [
        {
          start: number,
          duration: number
        }, ...
      ]
    }

Begin playback of the given content:

POST /device/id/play
    {
      content: string,
      start: number
    }
--> {}

Stop playback of the current content:

POST /device/id/stop
    {}
--> {}

Seek to the given position in the current content:

POST /device/id/scrub
    {
      position: number
    }
--> {}

Change the playback rate of the current content (0 = pause, 1 = resume):

POST /device/id/rate
    {
      value: number
    }
--> {}

Adjust the playback volume:

POST /device/id/volume
    {
      value: number
    }
--> {}

TODO: Post a photo for slideshow mode:

POST /device/id/photo
    {
      content: string,
      transition: string
    }
--> {}

Transcoding: install mac ports sudo port install ffmpeg +nonfree sudo port install mplayer +nonfree HTTP Live Streaming Tools

TODO: repackage on git so can be handled by npm somehow wget http://sourceforge.net/projects/mediainfo/files/binary/mediainfo/0.7.50/MediaInfo_CLI_0.7.50_GNU_FromSource.tar.bz2/download tar zxvf MediaInfo_CLI_0.7.50_GNU_FromSource.tar.bz2 cd MediaInfo_CLI_0.7.50_GNU_FromSource/ ./CLI_Compile.sh cd MediaInfo/Project/GNU/CLI && make install

MENCODER=$(which mencoder) MEDIAINFO=$(which mediainfo) FFMPEG=$(which ffmpeg) LSDVD=$(which lsdvd) XML=$(which xmlstarlet)

/Applications/VLC.app/Contents/MacOS/VLC -vv SOURCEFILE --intf=rc '--sout=#transcode{vcodec=h264,vb=2048,acodec=mp4a,ab=192}:standard{mux=ts,dst=-,access=file}' | mediastreamsegmenter -f /some/tmp/path/ -D