pxt-calliope/docs/reference/devices/tell-remote-control-to.md

91 lines
1.8 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# tell remote control to
Control the presentation of media content available on a remote device using the `tell remote control` to function.
## ~hint
2017-03-28 00:43:37 +02:00
![](/static/bluetooth/Bluetooth_SIG.png)
2016-03-26 00:47:20 +01:00
2017-03-28 00:43:37 +02:00
For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
2016-03-26 00:47:20 +01:00
## ~
2016-03-26 00:47:20 +01:00
2017-03-28 00:43:37 +02:00
2016-06-21 07:06:19 +02:00
```sig
2017-03-15 23:31:34 +01:00
devices.tellRemoteControlTo(MesRemoteControlEvent.play)
2016-03-26 00:47:20 +01:00
```
## Parameters
2016-03-26 00:47:20 +01:00
* event - an event identifier
## Event values
2016-03-26 00:47:20 +01:00
* play
* stop
* pause
* forward
* rewind
* volume up
* volume down
* previous track
* next track
## Examples
2016-03-26 00:47:20 +01:00
To tell the connected device to start playing:
2016-06-21 07:06:19 +02:00
```blocks
2017-03-15 23:31:34 +01:00
devices.tellRemoteControlTo(MesRemoteControlEvent.play)
2016-03-26 00:47:20 +01:00
```
To tell the connected device to stop playing
2016-06-21 07:06:19 +02:00
```blocks
2017-03-15 23:31:34 +01:00
devices.tellRemoteControlTo(MesRemoteControlEvent.stop)
2016-03-26 00:47:20 +01:00
```
To tell the connected device to go to next track
2016-06-21 07:06:19 +02:00
```blocks
2017-03-15 23:31:34 +01:00
devices.tellRemoteControlTo(MesRemoteControlEvent.nextTrack)
2016-03-26 00:47:20 +01:00
```
To tell the connected device to go to previous track
2016-06-21 07:06:19 +02:00
```blocks
2017-03-15 23:31:34 +01:00
devices.tellRemoteControlTo(MesRemoteControlEvent.previousTrack)
2016-03-26 00:47:20 +01:00
```
To tell the connected device to go forward
2016-06-21 07:06:19 +02:00
```blocks
2017-03-15 23:31:34 +01:00
devices.tellRemoteControlTo(MesRemoteControlEvent.forward)
2016-03-26 00:47:20 +01:00
```
To tell the connected device to rewind
2016-06-21 07:06:19 +02:00
```blocks
2017-03-15 23:31:34 +01:00
devices.tellRemoteControlTo(MesRemoteControlEvent.rewind)
2016-03-26 00:47:20 +01:00
```
To tell the connected device volume up
2016-06-21 07:06:19 +02:00
```blocks
2017-03-15 23:31:34 +01:00
devices.tellRemoteControlTo(MesRemoteControlEvent.volumeUp)
2016-03-26 00:47:20 +01:00
```
To tell the connected device volume down
2016-06-21 07:06:19 +02:00
```blocks
2017-03-15 23:31:34 +01:00
devices.tellRemoteControlTo(MesRemoteControlEvent.volumeDown)
2016-03-26 00:47:20 +01:00
```
## See also
2016-03-26 00:47:20 +01:00
2016-06-19 14:28:46 +02:00
[tell camera to](/reference/devices/tell-camera-to), [raise alert to](/reference/devices/raise-alert-to)
2016-03-26 00:47:20 +01:00
2016-06-21 07:06:19 +02:00
```package
devices
2016-06-21 07:06:19 +02:00
```