Skip to content

Latest commit

 

History

History
102 lines (84 loc) · 2.46 KB

File metadata and controls

102 lines (84 loc) · 2.46 KB

Documententation / API

(Class) ShaiportSync extends EventEmitter

Class

Create ShairportSync instance using:

new ShairportSync(output)

With this arguments:

Name Type Required Default
output Output false Stdout

Properties

ShairportSync instances expose the folowing properties:

Name Type Read-Only Default Desciption
process ChildProcess true Child process generated when receiver start
output Output true Stdout Output object
name String false Public name of the receiver (can be modified on stoped instance only)

Methods

ShairportSync instances expose the folowing methods:

Name Arguments Description
Name Type Required Default
start (options) Start airplay receiver
options Array false [] Custom options to be passed to shairport-sync command.

Events

You can listen to instance's events using:

const instance = new ShairportSync();

// Listen to 'START' event
instance.once(ShairportSync.Events.START, () => console.log('Receiver started.'));

ShairportSync.Events object contains the following events list:

Name Arguments Description
Name Type
START (instance) Emitted once shairport-sync process were spawned.
instance ShairportSync The ShairportSync instance that emitted this event