(Class) ShaiportSync extends EventEmitter
Create ShairportSync instance using:
new ShairportSync(output)With this arguments:
| Name | Type | Required | Default |
|---|---|---|---|
output |
Output | false | Stdout |
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) |
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. | |
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 | |