Instrucciones en español
Instructions en français
Instrucțiuni în limba română
The server for the cast software, which allows videos to be cast from a web browser to a Raspberry Pi.
Note: Due to Node.js no longer supporting ARMv6 in their newer releases, at least a Raspberry Pi 2 is required. There is a plan to eventually backport cast-server
to the original Raspberry Pi.
See the Raspberry Pi Website for instructions on how to install Raspbian.
Once Raspbian in installed and connected to the internet, run:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt install nodejs git omxplayer figlet
git clone https://gitlab.com/raspberry-pi-cast/cast-server
cd cast-server
npm install
setterm -powersave off -blank 0
cd cast-server
node server.js
Now, to cast videos to your Raspberry Pi, please use the cast add-on.
cast: GET, Casts a video.
Parameters:
video: string, URL of the video to play.
Return:
JSON-Encoded Data: {
status: int, MISSING_PARAMETERS if video if not specified, SUCCESS otherwise.
}
togglePause: GET, Toggles the pause status of a video.
Parameters:
None
Return:
JSON-Encoded Data: {
status: int, INVALID_PARAMETERS if the client IP address does not match the casting IP address, EXPIRED_CAST if no longer costing, SUCCESS otherwise.
}
skipForward: GET, Skips the video forward by 30 seconds.
Parameters:
None
Return:
JSON-Encoded Data: {
status: int, INVALID_PARAMETERS if the client IP address does not match the casting IP address, EXPIRED_CAST if no longer costing, SUCCESS otherwise.
}
skipBackwards: GET, Skips the video backwards by 30 seconds.
Parameters:
None
Return:
JSON-Encoded Data: {
status: int, INVALID_PARAMETERS if the client IP address does not match the casting IP address, EXPIRED_CAST if no longer costing, SUCCESS otherwise.
}
volumeUp: GET, Raises the video volume.
Parameters:
None
Return:
JSON-Encoded Data: {
status: int, INVALID_PARAMETERS if the client IP address does not match the casting IP address, EXPIRED_CAST if no longer costing, SUCCESS otherwise.
}
volumeDown: GET, Lowers the video volume.
Parameters:
None
Return:
JSON-Encoded Data: {
status: int, INVALID_PARAMETERS if the client IP address does not match the casting IP address, EXPIRED_CAST if no longer costing, SUCCESS otherwise.
}
isPlaying: GET, Returns whether the calling client has a video whether that is playing.
Parameters:
None
Return:
JSON-Encoded Data: {
isPlaying: isPlaying, true if the calling client has a playing video, false otherwise.
}
speedUp: GET, Increases the playback speed of the video.
Parameters:
None
Return:
JSON-Encoded Data: {
status: int, INVALID_PARAMETERS if the client IP address does not match the casting IP address, EXPIRED_CAST if no longer costing, SUCCESS otherwise.
}
slowDown: GET, Decreases the playback speed of the video.
Parameters:
None
Return:
JSON-Encoded Data: {
status: int, INVALID_PARAMETERS if the client IP address does not match the casting IP address, EXPIRED_CAST if no longer costing, SUCCESS otherwise.
}
toggleSubtitles: GET, Toggles whether the video has subtitles.
Parameters:
None
Return:
JSON-Encoded Data: {
status: int, INVALID_PARAMETERS if the client IP address does not match the casting IP address, EXPIRED_CAST if no longer costing, SUCCESS otherwise.
}