- Simple
- Apps
- Key actions
- TV
- Advanced input
activeApp() ⇒ Promise<
RokuApp
>
Retrieves information about the current application
activeChannel() ⇒ Promise<
RokuActiveChannel
>
Retrieves information about the currently tuned TV channel. Restricted to Roku TV devices that support live TV
Creates a new instance of the App
class
Param | Type | Description |
---|---|---|
appInfo | RokuAppInfo |
App information (id required) |
const apps = await myRoku.apps();
const firstApp = myRoku.app(apps[0]);
const neflix = myRoku.app({ id: 12 });
apps() ⇒ Promise<
RokuApp
[]>
Retrieves information about the device's applications
channels() ⇒ Promise<
RokuChannel
[]>
Retrieves information about the TV channel / line-up available for viewing in the TV tuner UI. Restricted to Roku TV devices that support live TV
static discover(timeout?) ⇒ Promise<
SSDPDevice
[]>
Discovers local devices using SSDP. This is a static method
Param | Type | Description |
---|---|---|
timeout | number |
Timeout duration in milliseconds |
const devices: SSDPDevice[] = await Roku.discover(5000);
console.log(devices);
Sends a GET request, with optional parameters
Param | Type | Description |
---|---|---|
path | string |
Request path URL |
params | Object |
Request parameters |
Returns an icon corresponding to the identified application
Param | Type | Description |
---|---|---|
id | number |
The id of the app |
const ws = createWriteStream(__dirname + "/out.png");
myRoku.icon(837).then((res) => res.body.pipe(ws)); // YouTube app icon
info() ⇒ Promise<
RokuDevice
>
Retrieves information about the device
Sends custom events to the current application
Param | Type | Description |
---|---|---|
options | InputOptions |
Input parameters |
Exits the current channel, and launches the Channel Store details screen of the identified app.
Param | Type | Description |
---|---|---|
id | id |
The app ID |
Equivalent to pressing the identified remote control key
Param | Type | Description |
---|---|---|
key | Keys |
The key to be pressed |
Equivalent to releasing the identified remote control key
Param | Type | Description |
---|---|---|
key | Keys |
The key to be released |
Launches the identified app. Can accept launch parameters for deep linking
Param | Type | Description |
---|---|---|
id | number|"dev" |
The id of the app |
options | LaunchOptions |
Launch parameters (for deep linking) |
// launch the dev channel:
myRoku.launch("dev");
// launch Netflix, loading a specific show:
myRoku.launch(12, { contentId: "70206978", mediaType: "series" });
Launches the identified channel. Restricted to Roku TV devices that support live TV
Param | Type | Description |
---|---|---|
id | number |
The channel number |
mediaPlayer() ⇒ Promise<
MediaPlayerInfo
>
Retrieves information about the current stream segment and position of the content being played, the running time of the content, audio format, and buffering
Sends a POST request with no body, and optional parameters
Param | Type | Description |
---|---|---|
path | string |
Request path URL |
params | Object |
Request parameters |
Equivalent to pressing down and releasing the identified remote control key. Can accept keyboard alphanumeric characters when a keyboard screen is active
Param | Type | Description |
---|---|---|
keys | (string| Keys )[] |
An array of keys to press, or characters to type |
const sequence: Keys[] = [Keys.DOWN, Keys.DOWN, Keys.RIGHT];
myRoku.press(...sequence);
Enables an external client to drive the Roku Search UI to find and (optionally) launch content from an available provider
Param | Type | Description |
---|---|---|
options | SearchOptions |
Search options |
myRoku.search({ keyword: "Game of Thrones" });
Equivalent to pressing the ten-to-twelve key pattern to launch a secret screen on the Roku screen. Only two screens are supported by the ECP (HDMI Info Screen and Channel Info Screen)
Param | Type | Description |
---|---|---|
screen | Screen |
The secret screen code |
myRoku.secretScreen(Screens.CHANNEL_INFO);
myRoku.secretScreen(Screens.HDMI_INFO);
Sends custom sensor events to the device
Param | Type | Description |
---|---|---|
input | SensorType |
The sensor type |
values | Dim3Values |
The sensor input values |
Sends custom touch or multi-touch events to the device
Param | Type | Description |
---|---|---|
values | Dim2Values |
The touch input values |
op | TouchOp |
The touch operation |
Types alphanumeric characters, provided a keyboard screen is active
Param | Type | Description |
---|---|---|
input | string |
Text to be typed |
myRoku.type("Phoebe Bridgers");
Wait between key presses
Param | Type | Description |
---|---|---|
ms | number |
Delay time in milliseconds |
// hold the down button for two seconds:
myRoku.keyDown(Keys.DOWN);
myRoku.wait(2000);
myRoku.keyUp(Keys.DOWN);