Windows Media Player 11 SDK Changing Attribute ValuesÂ
Previous | Next |
Changing Attribute Values
You can change the value of an attribute if your Web page or application has read/write access to the library and the attribute can be both read and written.
You can change an attribute of the current media item. To change attributes of multiple media items, you can assign each one in turn to the Player**.currentMedia** property.
Throughout this topic, the Player object was defined in the following manner:
AxWMPLib.AxWindowsMediaPlayer Player; using WMPLib;
To change an attribute, call the Player**.currentMedia.setItemInfo** method as shown in the following C# example.
IWMPMedia3 media; // Initialize the Media object media = Player.currentMedia; // Set the new genre value media.setItemInfo("WM/Genre", "My New Genre");
We recommend that you call the Media**.isReadOnlyItem** method to determine whether you can change a particular attribute.
Note If you embed the control in your application, file attributes that you change will not be written to the digital media file until the user runs Windows Media Player. If you use the control in a remoted application written in C++, file attributes that you change will be written to the digital media file shortly after you make the changes. In either case, the changes are immediately available to you through the library.
See Also
Previous | Next |