# How can I play a file from Media server using http api?

**URL:** <https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [May 23, 2009, 8:17pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841 "2009-05-23T20:17:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jurgen](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@Jurgen](https://forums.plex.tv/u/Jurgen)\
**Post date:** [May 23, 2009, 8:17pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/1 "2009-05-23T20:17:05Z")

</div>

Starting a file on Plex as found in the Media server
Hi all,  
  
Sorry for asking again, but does anyone know how to start a file as found in the Plex Media Server (thanks Jam for helping me in thata area). The http interface gives me all details of files located in the Plex Media server .. but I can't get a file to start playin in a normal way ... the only way I got a music file started is to add the full http address of the media server location .. so for example http://:3000/xbmcCmds/xbmcHttp?command=PlayFile(http://:32400/music/iTunes/Tracks/Y/17444.mp3)... it starts but Plex sees it as a stream...  
  
Is there a way I can address a music, picture, video file in the Plex Media Server to start is using the http api. A side question is : does it start like starting a music file in Plex (so sequential files are also played) .. and can a shuffle or party mode still be started??  
  
Thanks again for all your help out there!  
  
Rgds,  
JayTee

---

<div class="post-metadata">

**Author:** ![Jurgen](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@Jurgen](https://forums.plex.tv/u/Jurgen)\
**Post date:** [June 29, 2009, 12:49pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/2 "2009-06-29T12:49:11Z")

</div>

Hi all there …  
  
  
  
Nobody knows a solution??? Dev team … are you working on an interface? An interface like Squeezecenter would be excellent (they use port 9090 to enable all commands and makes integration in central controlled system very comfortable ;).  
  
  
  
Thanks for any reply.  
  
  
  
  
  
Rgds,  
  
JayTee

---

<div class="post-metadata">

**Author:** ![hnke](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@hnke](https://forums.plex.tv/u/hnke)\
**Post date:** [January 24, 2010, 4:31pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/3 "2010-01-24T16:31:49Z")

</div>

I’m also very interested in this kind of interface, any suggestions?

---

<div class="post-metadata">

**Author:** ![waw74](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@waw74](https://forums.plex.tv/u/waw74)\
**Post date:** [February 19, 2010, 7:26pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/4 "2010-02-19T19:26:41Z")

</div>

I am also trying to get this to work.   
  
I have a 7" touchscreen hooked to an old laptop, i’ve made a decent interface /remote to control plex, but it would be great to be able to select and play music without having the TV on.  
  
i don’t use the local plex library for music, only for video. which means i can query the video database, and play video files back without the tv on, but that really isn’t that productive.  
  
My music all comes from iTunes on my laptop.  
  
  
  
Currently i can get the list of artist from PMS using

```auto

http://ip.of.PMS:32400/music/iTunes/artists/

```

and then can continue further down to artists or individual albums  
  
  
  
and once I’ve gotten the artist or album i can bring up that on the main plex screen by

```auto

http://ip.of.plex.machine:3000/xbmcCmds/xbmcHttp?command=ExecBuiltIn(ActivateWindow(10501,plex://ip.of.PMS/music/iTunes/Artists/The%20Beatles/18728/))

```

  
  
but i haven't found a way to make it play either a song or particular album  
  
i've tried many combinations of the following, using either plex:// or http://, and with and without the "18710.mp3"  

```auto

<br />
.../xbmcCmds/xbmcHttp?command=execbuiltin(playmedia(http://ip.of.PMS:32400/music/iTunes/Artists/The Beatles/18728/18710.mp3))<br />
.../xbmcCmds/xbmcHttp?command=playfile(plex://ip.of.PMS/music/iTunes/Artists/The Beatles/18728/18710.mp3)<br />

```

  
  
I've also tried to create or add to a playlist, but that also fails, works great on video though. (tried this using both "http://:32400" and "Plex://"  

```auto

.../xbmcCmds/xbmcHttp?command=AddToPlayList(http://ip.of.PMS:32400/music/iTunes/artists/The%20Beatles/18728/18710.mp3;0)

```

  
  
once, i did get it to play using the playfile method, but as the OP said, it just played "18710.mp3" as opposed to the tagged song out of the library.

---

<div class="post-metadata">

**Author:** ![elan](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/elan/32/5_2.png) [@elan](https://forums.plex.tv/u/elan)\
**Post date:** [February 19, 2010, 11:52pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/5 "2010-02-19T23:52:47Z")

</div>

In the Plex/Nine series we have an improved remote control interface which we’ll detail once it’s released. That should help the process of playing media from the Plex Media Server on Plex clients.

---

<div class="post-metadata">

**Author:** ![Jurgen](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@Jurgen](https://forums.plex.tv/u/Jurgen)\
**Post date:** [February 21, 2010, 8:10pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/6 "2010-02-21T20:10:05Z")

</div>

> [@](#):
>
> In the Plex/Nine series we have an improved remote control interface which we'll detail once it's released. That should help the process of playing media from the Plex Media Server on Plex clients.

  
  
Hi Elan,  
  
Eagerly waiting the new release ;) ... this is what I have been waiting for for months ;)) .. but hopefully worth the waiting. Keep on doing the good work and I will get more people to use Plex!!  
If you have any details of the new control which you might wanna share, please send them by PM . I am currently developing software for homecontrol units and still struggling with the response and control of Plex.... starting to develop UDP calls to the event client .. removing the burden of a full http interface...  
  
Best regards,  
JT

---

<div class="post-metadata">

**Author:** ![cjbottaro](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/cjbottaro/32/112637_2.png) [@cjbottaro](https://forums.plex.tv/u/cjbottaro)\
**Post date:** [May 22, 2011, 3:37am UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/7 "2011-05-22T03:37:26Z")

</div>

> [@](#):
>
> In the Plex/Nine series we have an improved remote control interface which we'll detail once it's released. That should help the process of playing media from the Plex Media Server on Plex clients.

  
Any update on this? Thanks.

---

<div class="post-metadata">

**Author:** ![Drregor](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@Drregor](https://forums.plex.tv/u/Drregor)\
**Post date:** [October 31, 2012, 4:13pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/8 "2012-10-31T16:13:32Z")

</div>

Not sure if this is helpful or not, but I use curl to send commands to play specific files.  
  
  
  
I use a PHP script as its easier to edit, so I use curl and php

```auto

<?php<br />
<br />
$server = "ServerName";<br />
$mediaserver = "MediaServerName";<br />
$player = "ClientName";<br />
$section = "13";<br />
$media = "50600";<br />
<br />
echo exec("curl -v --raw --ignore-content-length 'http://$server:32400/system/players/$player/application/playMedia?path=http%3A%2F%2F$mediaserver%3A32400%2Flibrary%2Fsections%2F$section%2Fall&key=%2Flibrary%2Fmetadata%2F$media'");<br />
<br />
?><br />

```

  
  
Servername and MediaServername are the same in my case, I use IP's just to be sure, clientname is the client, Section and Media can be gotten from the plex management web site.   
  
you should be able to just pull the curl command our there and run it from a linux terminal, just replace the variables in the url ($media etc).  

```auto

curl -v --raw --ignore-content-length 'http://$server:32400/system/players/$player/application/playMedia?path=http%3A%2F%2F$mediaserver%3A32400%2Flibrary%2Fsections%2F$section%2Fall&key=%2Flibrary%2Fmetadata%2F$media'

```

  
  
 The reason I made it easy to edit is since my media key kept changing as I tested things. I am pointing to a symbolic link that changes daily, and I run the above php command via a cron job as an alarm clock type setup.

---

<div class="post-metadata">

**Author:** ![jklaslfjsadflj](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@jklaslfjsadflj](https://forums.plex.tv/u/jklaslfjsadflj)\
**Post date:** [November 1, 2012, 4:28pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/9 "2012-11-01T16:28:21Z")

</div>

Hey JayTee,  
  
  
  
Join PlexPass and you will hopefully see those updates a little early! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 8:27pm UTC](https://forums.plex.tv/t/how-can-i-play-a-file-from-media-server-using-http-api/1841/10 "2019-12-20T20:27:03Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
