VideoProperties class
Provides access to the video-related properties of an item (like a file or folder).
Syntax
Attributes
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The VideoProperties class has these types of members:
Methods
The VideoProperties class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| RetrievePropertiesAsync | Retrieves the specified properties associated with the item. |
| SavePropertiesAsync() | Saves all properties associated with the item. |
| SavePropertiesAsync(IIterable(IKeyValuePair)) | Saves the specified properties and values associated with the item. |
Properties
The VideoProperties class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the sum audio and video bitrate of the video. | |
| Read-only | Gets the directors of the video. | |
| Read-only | Gets the duration of the video. | |
| Read-only | Gets the height of the video. | |
| Read-only | Gets the collection of keywords associated with the video. | |
| Read-only | Gets the latitude coordinate where the video was shot. | |
| Read-only | Gets the longitude coordinate where the video was shot. | |
| Read-only | Gets a VideoOrientation value that indicates how the video should be rotated to display it correctly. | |
| Read-only | Gets the producers of the video. | |
| Read/write | Gets or sets the publisher of the video. | |
| Read/write | Gets the rating associated with the video. | |
| Read/write | Gets or sets the subtitle of the video. | |
| Read/write | Gets or sets the title of the video. | |
| Read-only | Gets the width of the video. | |
| Read-only | Gets the script writers for the video. | |
| Read/write | Gets or sets the year that the video was shot or released. |
Remarks
You can access a VideoProperties object asynchronously using the getVideoPropertiesAsync method from the Properties property of an item (like a file of folder), or synchronously using the VideoProperties property if it is available.
You can get a VideoProperties object using any of the following methods and properties:
- StorageItemContentProperties.getVideoPropertiesAsync method, which can be accessed using the Properties property, if it is available.
- FileInformation.videoProperties property
- FolderInformation.videoProperties property
Note Properties that are get or set using a property handler that is defined by another app (like Microsoft Word) may not be accessible. Instead, you can try to get these properties using a file query that is backed by the system index. For more information, see QueryOptions.
For more code samples about accessing properties, see the File access sample.
Examples
This example demonstrates how to retrieve properties of a file, including video properties like Year and Rating.
try { StorageFile file = rootPage.sampleFile; if (file != null) { StringBuilder outputText = new StringBuilder(); // Get video properties VideoProperties videoProperties = await file.Properties.GetVideoPropertiesAsync(); outputText.AppendLine("Year: " + videoProperties.Year); outputText.AppendLine("Rating: " + videoProperties.Rating); } } // Handle errors with catch blocks catch (FileNotFoundException) { // For example, handle a file not found error }
After GetVideoPropertiesAsync completes, videoProperties gets a VideoProperties object.
In the example, file contains a StorageFile that represents the file to retrieve properties for.
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
- StorageItemContentProperties.getVideoPropertiesAsync method
- Windows.Storage.BulkAccess.FileInformation.videoProperties property
- Windows.Storage.BulkAccess.FolderInformation.videoProperties property
- Windows.Storage.BulkAccess.IStorageItemInformation.VideoProperties property
Build date: 2/25/2013