-
Notifications
You must be signed in to change notification settings - Fork 3
Methods
Augustin Roux edited this page Jul 3, 2015
·
2 revisions
The R7
function sends an RPC request and associate it with a callback handling the response.
R7(method, [callback], [context])
R7(method, params, [callback], [context])
Little helper to access the navigate
method.
R7.navigate(route, options, callback, context)
Equivalent to:
R7('navigate', { control: route, context: options }, callback, context)
Execute a callback (the boot callback) when the iframe is loaded. You should always put booting process in the given callback of this function.
R7.ready(callback, [context])
Execute an action when a key is pressed. If a key is already bound, the former action is overridden.
R7.grabKey(key, callback , [context])
-
key
The name of the key as listed below. You can also pass an Object to activate the throttle:{ KeyName: { after: 300, throttle: 100 } }
. The callback will be fired every 100ms after 300ms if the user holds the key. -
callback
The callback function that will be executed when the key is pressed -
context
: Context of execution of the callback
The keys that can be grabbed are:
- Up
- Down
- Right
- Left
- Enter
- Mute
- Zoom
- Back
- Exit
- Guide
- Menu
- Numeric
- Rewind
- Play
- Forward
- Stop
- Pause
- Rec
- TV
Unbind an action linked to the given key
R7.releaseKey(key)
Registers the specified listener to an event. See the list of events listenable in external applications|EventsList.
R7.addStreamListener(event, callback, [context]);
Works only in the iframe application, closes itself.
R7.exit();