Answered by:
PlayTo API c# metadata not correct

Question
-
Hello,
In my application that suppors the PlayTo API, I have made tests to stream the playing audio file to both Windows Media Player and a WD TV Live device.
No matter which device I stream to, the metadata is shown as "Media from application name", despite I have set the proper information in the MediaControl class. (MediaControl.ArtistName, MediaControl.TrackName).
How should this be implemented properly so that the proper meta data is shown in the target PlayTo device?
Sunday, January 13, 2013 11:51 AM
Answers
-
Hello, thanks for your reply.
I was refering to the MediaControl class (http://msdn.microsoft.com/en-us/library/windows/apps/hh700786.aspx) which has the attributes (ArtistName, TrackName) which needs to be set (afaik) to have the proper information to be shown for background audio applications.
The MediaElement has no ways to to set this kind of meta data.
I have seen the examples above and my implementation follows the same pattern as theire. PlayTo works fine but no matter what I do the metadata shown in the PlayTo device I stream to as "Media from my application" (my application is the display name of my application).
If I select the stream from the receiver (Windows Media Player for example), and then select properties, I can see that this is mapped to the title field. The other fields are empty.
So, the question remains, how can I set album, artist etc. when streaming to a PlayTo connected device ?
- Marked as answer by Imploded Software Tuesday, January 22, 2013 7:53 AM
Monday, January 14, 2013 9:31 AM -
"Media from [App Name]" is displayed when there is nothing in the PKEY_Title or PKEY_ItemNameDisplay attributes when the source is queried for its property store.
What are you streaming from, a custom media source, a file or an internet site?
- For a custom source you'll need to support the metadata service (MF_PROPERTY_HANDLER_SERVICE) see http://msdn.microsoft.com/en-us/library/windows/desktop/ff384868(v=vs.85).aspx
- For a file that should already be supported.
- For an internet source that metadata is usually not available.
David
-- David
- Proposed as answer by David S. [MSFT]Microsoft employee Thursday, January 17, 2013 7:26 PM
- Marked as answer by Imploded Software Tuesday, January 22, 2013 7:53 AM
Thursday, January 17, 2013 7:16 PM
All replies
-
There is some points i did not understood.
MediaControl class? You are you talking about MediaElement class ?
Did you saw this:
Streaming media to devices using Play To
Quickstart: Streaming a slide show using Play
Sara Silva - Microsoft Visual C# MVP
My blog | My Windows 8 Store Apps Samples | More Samples
Follow me in Twitter @saramgsilva
My Windows 8 Store Apps: Female Pill | Galinho (Tic tac Toe) | 24 | My Snake
My Windows Phone AppsMonday, January 14, 2013 12:24 AM -
Hello, thanks for your reply.
I was refering to the MediaControl class (http://msdn.microsoft.com/en-us/library/windows/apps/hh700786.aspx) which has the attributes (ArtistName, TrackName) which needs to be set (afaik) to have the proper information to be shown for background audio applications.
The MediaElement has no ways to to set this kind of meta data.
I have seen the examples above and my implementation follows the same pattern as theire. PlayTo works fine but no matter what I do the metadata shown in the PlayTo device I stream to as "Media from my application" (my application is the display name of my application).
If I select the stream from the receiver (Windows Media Player for example), and then select properties, I can see that this is mapped to the title field. The other fields are empty.
So, the question remains, how can I set album, artist etc. when streaming to a PlayTo connected device ?
- Marked as answer by Imploded Software Tuesday, January 22, 2013 7:53 AM
Monday, January 14, 2013 9:31 AM -
"Media from [App Name]" is displayed when there is nothing in the PKEY_Title or PKEY_ItemNameDisplay attributes when the source is queried for its property store.
What are you streaming from, a custom media source, a file or an internet site?
- For a custom source you'll need to support the metadata service (MF_PROPERTY_HANDLER_SERVICE) see http://msdn.microsoft.com/en-us/library/windows/desktop/ff384868(v=vs.85).aspx
- For a file that should already be supported.
- For an internet source that metadata is usually not available.
David
-- David
- Proposed as answer by David S. [MSFT]Microsoft employee Thursday, January 17, 2013 7:26 PM
- Marked as answer by Imploded Software Tuesday, January 22, 2013 7:53 AM
Thursday, January 17, 2013 7:16 PM -
Thanks for your answer, that seems to be correct.
In my case, I'm streaming MP3 files (containing tags with artist, title etc.) from an Uri.
Do I need to treat this as a custom media source, and if so can the metadata service be used from c# in WinRT? (It seems to be a desktop COM API).
Thursday, January 17, 2013 7:31 PM -
You would need to create a media source in C++. You can look at the Media Extensions Sample http://code.msdn.microsoft.com/windowsapps/Media-extensions-sample-7b466096 on how to create a custom media source. On the media source you would need to implement IMFService which would be used to expose the IPropertyStore through MF_PROPERTY_HANDLER_SERVICE that then could access the tags to supply the information.
One of the few challenges you'll run into is not being able to access the information from the mp3 file since it could be written at the end of the file and the server might not support seeking.
-- David
Monday, January 21, 2013 9:25 PM -
Thanks for the link, I will Review it further to see if I can implement it.Tuesday, January 22, 2013 7:53 AM