Skip to content

Commit 4c9b66f

Browse files
committed
Add linein action
1 parent 51de358 commit 4c9b66f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/actions/linein.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
function linein(player, values) {
4+
const sourcePlayerName = values[0];
5+
let lineinSourcePlayer = player;
6+
7+
if (sourcePlayerName) {
8+
lineinSourcePlayer = player.system.getPlayer(decodeURIComponent(sourcePlayerName));
9+
}
10+
11+
if (!lineinSourcePlayer) {
12+
return Promise.reject(new Error(`Could not find player ${sourcePlayerName}`));
13+
}
14+
15+
const uri = `x-rincon-stream:${lineinSourcePlayer.uuid}`;
16+
17+
return player.coordinator.setAVTransport(uri);
18+
}
19+
20+
module.exports = function (api) {
21+
api.registerAction('linein', linein);
22+
}

0 commit comments

Comments
 (0)