ifInput
Implemented by
| Name | Description |
|---|---|
| roInput | An roInput object can be used to receive events sent from a network client using the External Control Protocol (ECP), as described in External Control API |
Supported methods
GetMessagePort() as Object
Description
Returns the message port (if any) currently associated with the object.
Return Value
The message port value.
SetMessagePort(port as Object) as Void
Description
Sets the roMessagePort to be used to receive events.
Parameters
| Name | Type | Description |
|---|---|---|
| port | Object | The port to be used to receive events. |
EnableTransportEvents() as Boolean
Description
Registers an app to receive roInput transport events, which are voice commands sent via the Roku remote control, Roku mobile app, or a virtual assistant such as Amazon Alexa or Google Assistant.
Voice commands include the following: "fast forward", "next, "play", "pause", "replay", "rewind", "seek", and "startover". Once you register your app to receive transport events, your app must call the EventResponse() method to handle them.
See Implementing Voice Controls for more information.
Return Value
A flag indicating whether transport event notifications were successfully registered.
EventResponse(roAssociativeArray aa) as Boolean
Description
Marks a transport command as handled, unhandled, or handled with an error.
If your app has registered for handling transport events (by calling the EnableTransportEvents()function on an roInput object), it must call this method within 5 seconds of receiving a transport event. This is because the Roku OS needs to know whether a transport command has been handled, unhandled, or handled with an error. If a transport event is marked as unhandled, the Roku OS can provide the default behavior. If a transport event is marked as handled with an error, the Roku OS can provide on-screen feedback.
If your app has registered for transport events, but does not call this method within 5 seconds of receiving a transport event, the event is considered unhandled.
Parameters
This method takes an AssociativeArray with two fields: id and status. The id field specifies the transport ID event; the status specifies whether the event was handled, handled with an error, or unhandled.
| Parameter | Type | Description |
|---|---|---|
| Id | String | The unique ID of the transport event. |
| status | String | Indicates whether the event was handled successfully, handled with an error, or unhandled. This may be one of the following values:
|
Return Value
A flag indicating whether the event response operation was successful.
Updated 3 months ago
