-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdisplayconf-chromecast.js
More file actions
45 lines (40 loc) · 1.74 KB
/
displayconf-chromecast.js
File metadata and controls
45 lines (40 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { DisplayChromecast } from "./ledder/server/drivers/DisplayChromecast.js"
import { RenderRealtime } from "./ledder/server/RenderRealtime.js"
/**
* Example configuration for streaming Ledger animations to a Chromecast device
*
* Usage:
* 1. Make sure you have a Chromecast device on your local network
* 2. Update the deviceName below to match your Chromecast, or use IP address directly
* 3. Copy this file to displayconf.js
* 4. Run: npm run build && npm run start
* 5. The animation will stream to your Chromecast TV
*
* Tips:
* - Leave deviceName empty ("") to auto-select first found Chromecast
* - Use partial name like "Living" to match "Living Room TV"
* - Use IP address like "192.168.1.217" for direct connection without discovery
*/
// Create Chromecast display
// Parameters: width, height, deviceName, serverPort, localIp, autoConnect
const display = new DisplayChromecast(
64, // Width in Ledger pixels
64, // Height in Ledger pixels
"", // Device name or IP (examples: "", "Living Room", "192.168.1.217")
8765, // HTTP server port for streaming
"", // Local IP (auto-detected if empty)
true // Auto-connect on startup
)
// Create renderer with the Chromecast display
const render = new RenderRealtime()
await render.addDisplay(display)
// Set animation to render
// You can use any animation from the ReinsCollection or Tests folders
render.animationManager.setAnimation("Tests/TestGrid/default")
// render.animationManager.setAnimation("ReinsCollection/Rainbowcross/default")
// render.animationManager.setAnimation("ReinsCollection/Cube/default")
export default {
render: render,
animation: "Tests/TestGrid/default",
port: 3000
}