Media
The media class is an object that allows us to get a media from ImageVault. It mainly contains the URL to the original item and cannot be manipulated in any way.
var client = ClientFactory.GetSdkClient();
//get the url to the media with id 234
var url = client.Load<Media>(234).Single().Url;
Get media by a specific format id
Instead of retrieving the original format, you can specify a mediaFormatId to retrieve the media for by using the UseFormat method.
var mediaByFormatId = client.Load<Media>(2231).UseFormat(345);
Get media by a specific format
You can also specify a format using a format instance instead of supplying the id of the format. If the format does not exists, a suitable format is created.
var mediaByFormat = client.Load<Media>(1231).UseFormat(new ThumbnailFormat { Width = 200 });
Get a list of items
If you want to retrieve a list of specific items you can pass their ids to the Load method as well and get an IEnumerable in return that allows you to use the methods above for manipulating the result.
var mediaList = client.Load<Media>(new int[] { 1, 2, 3, 4 })
.UseFormat(new ThumbnailFormat { Width = 200 })
.ToList();
Displaying the media
How to display the media to a user depends on the type of media that is returned. The type of media can be determined by checking the ContentType property. For some media a specific player is needed. This can be determined by inspecting the ContentDisplayType property. If this is set to ContainsPlayer then the Html property contains the html required to display the media on a web page. The Html property can contain a default html to be used if ImageVault knows how to display the media.
For other data, use the URL property to access the media directly.