INTERACT FORUM
Windows => Plug-in Development => Topic started by: kensn on September 20, 2013, 11:42:56 am
-
I looked a coulple of times, but is there a way to get Media Type or Media SubType from the current playing file for MCWS?
Thanks,
Ken
-
Get the currently playing file:
http://localhost:52199/MCWS/v1/Playback/Info?Zone=-1
<Response Status="OK">
<Item Name="ZoneID">0</Item>
<Item Name="ZoneName">Music - main</Item>
<Item Name="State">2</Item>
<Item Name="FileKey">3872499</Item>
...
and from that you'll have the FileKey, which you'll use to get info on the file, asking for just the File Type:
http://localhost:52199/MCWS/v1/File/GetInfo?File=3872499&Fields=File%20Type
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<MPL Version="2.0" Title="MCWS - Files - 9048">
<Item>
<Field Name="Key">3872499</Field>
<Field Name="File Type">flac</Field>
</Item>
</MPL>
-
Yea I saw I could get the File Type, but there are many file types that can make up "Audio". Was just looking to see if I could get MediaType = Audio.
Ken
-
Sorry, I gave instructions for File Type, not Media Type/Media Sub Type, which would be:
http://localhost:52199/MCWS/v1/File/GetInfo?File=3872499&Fields=Media%20Sub%20Type,Media%20Type
-
Fields...
Thanks MrC
Ken
-
This seems to want to give me an MPL file.. No way to get a return value???
Ken
-
It doesn't output a file, but an MPL stream with MIME Content-Type: application/x-mediajukebox-mpl. Since you're probably using your browser, the browser doesn't know what to do with the output, since it offers to store the result to a file.
How do you intend to make the call?
Example:
$ curl 'http://localhost:52199/MCWS/v1/File/GetInfo?File=3872499&Fields=Media%20Sub%20Type,Media%20Type'
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<MPL Version="2.0" Title="MCWS - Files - 4712">
<Item>
<Field Name="Key">3872499</Field>
<Field Name="Media Type">Audio</Field>
</Item>
</MPL>
-
OK... Back to the grind..
Thanks,
Ken