# Obtaining the Kodi Player id and the using of id

**URL:** https://discourse.nodered.org/t/obtaining-the-kodi-player-id-and-the-using-of-id/20276
**Category:** Dashboard
**Created:** [13 January 2020 18:33 UTC](https://discourse.nodered.org/t/obtaining-the-kodi-player-id-and-the-using-of-id/20276 "2020-01-13T18:33:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![konrul](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@konrul](https://discourse.nodered.org/u/konrul)
#### Post date: [13 January 2020 18:33 UTC](https://discourse.nodered.org/t/obtaining-the-kodi-player-id-and-the-using-of-id/20276/1 "2020-01-13T18:33:55Z")

</div>

Hello, I have discovered something new!

{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}

This code obtains which player is active.

It returns as:  
{"id": 1, "jsonrpc": "2.0", "result": [{ "playerid": 0, "type": "audio" }]}

if playerid is 0 it is an audio file, if playerid is 1 it is a video file. These values are vital if you want to control Kodi. So Node-red and Kodi work are getting harder.  
How can I use this code

```auto
{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}

```

and then how can I obtain the player data to use in?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [13 January 2020 20:38 UTC](https://discourse.nodered.org/t/obtaining-the-kodi-player-id-and-the-using-of-id/20276/2 "2020-01-13T20:38:12Z")

</div>

Remember that someone reading this thread may not be familiar with the other threads that have gone before. I suggest you edit your post and add some information about which node you are using and what you are doing with object you have shown.
