INTERACT FORUM

Windows => Plug-in Development => Topic started by: kensn on September 20, 2013, 11:42:56 am

Title: MCWS - Get Media TYpe or Media SubType
Post 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
Title: Re: MCWS - Get Media TYpe or Media SubType
Post by: MrC on September 20, 2013, 12:13:58 pm
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>
Title: Re: MCWS - Get Media TYpe or Media SubType
Post by: kensn on September 20, 2013, 12:22:40 pm
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
Title: Re: MCWS - Get Media TYpe or Media SubType
Post by: MrC on September 20, 2013, 12:39:32 pm
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
Title: Re: MCWS - Get Media TYpe or Media SubType
Post by: kensn on September 20, 2013, 12:44:12 pm
Fields...

Thanks MrC

Ken
Title: Re: MCWS - Get Media TYpe or Media SubType
Post by: kensn on September 20, 2013, 07:45:59 pm
This seems to want to give me an MPL file.. No way to get a return value???

Ken
Title: Re: MCWS - Get Media TYpe or Media SubType
Post by: MrC on September 20, 2013, 08:19:10 pm
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>
Title: Re: MCWS - Get Media TYpe or Media SubType
Post by: kensn on September 20, 2013, 08:22:44 pm
OK... Back to the grind..

Thanks,
Ken