AssetFiles
A file is an actual video or audio blob object on the file system or on a remote server. A file is always associated with an asset, and an asset may contain one or many files. The Media Services task will fail if an AssetFile object is not associated with a physical file in a blob container.
Important |
|---|
| When accessing entities in Windows Azure Media Services, you must set specific header fields and values in your HTTP requests. For more information, see Setup for Media Services REST API Development. |
-
AssetFile Entity Properties
-
Create an AssetFile
-
List AssetFiles
-
Update an AssetFile
-
Delete an AssetFile
Important |
|---|
| After successfully connecting to https://media.windows.net, you will receive a 301 redirect specifying another Media Services URI. You must make subsequent calls to the new URI. |
AssetFile Entity Properties
| Property | Type | Description |
|---|---|---|
|
Id |
Edm.String |
Unique identifier set by Media Services. |
|
Name |
Edm.String |
Optional. Friendly name for your AssetFile. The default value is the filename you used during your file upload. |
|
ContentFileSize |
Edm.Int64 |
AssetFile size (in bytes) of the content. |
|
ParentAssetId |
Edm.String |
Asset Id of the Asset that this file is associated with. |
|
EncryptionVersion |
Edm.String |
Optional. Current supported version for both StorageEncryption and CommonEncryption is "1.0" |
|
EncryptionScheme |
Edm.String |
Optional. The encryption scheme used for this file. The valid values are: "StorageEncryption" or "CommonEncryption". |
|
IsEncrypted |
Edm.Boolean |
Optional. This value should be set to true if this file is stored encrypted. |
|
EncryptionKeyId |
Edm.String |
Optional. Encrypted ContentKey Id. |
|
InitializationVector |
Edm.String |
Optional. The initialization vector used for storage encryption. |
|
IsPrimary |
Edm.Boolean |
Optional. Determines if this file is the primary file in a multi-file Asset. |
|
LastModified |
Edm.DateTime |
This value is updated by Media Services after any property changes are made. It represents the number of milliseconds since midnight Jan 1, 1970. |
|
Created |
Edm.DateTime |
This value is set by Media Services at creation time. It represents the number of milliseconds since midnight Jan 1, 1970. |
|
MimeType |
Edm.String |
Optional. Media Services does not inspect any blob that you uploaded, so you must manually set the mime type. For example, "text/plain" or "video/x-ms-wmv" are valid values to use. |
|
ContentChecksum |
Edm.String |
Optional. A hexadecimal number representing a MD5 (RFC 1321) message digest value. This value is set by the client or client library to serve as a validation of the successful upload of the content. |
Create an AssetFile
The CreateFileInfos function is used to create a new AssetFile entity. For more information, see REST API Functions.
List AssetFiles
AssetFiles are retrieved using a GET HTTP request.
| Method | Request URI | HTTP Version |
|---|---|---|
|
GET |
https://media.windows.net/API/Files |
HTTP/1.1 |
| Method | Request URI | HTTP Version |
|---|---|---|
|
GET |
https://media.windows.net/API/Files('fileid') |
HTTP/1.1 |
| Method | Request URI | HTTP Version |
|---|---|---|
|
GET |
https://media.windows.net/API/Assets('assetid')/Files |
HTTP/1.1 |
Sample Request
GET https://media.windows.net/API/Files('nb:cid:UUID:d0214595-fff0-164e-9c67-d576eba09605') HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.1
Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=youraccountname&urn%3aSubscriptionId=2f84471d-b1ae-4e75-aa09-010f0fc0cf5b&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1337178759&Issuer=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&HMACSHA256=cKlWvRDsu0bQwDkc1A4sMM5OQOGBEk8OWcuaj9zDkp0%3d
Host: media.windows.net
Update an AssetFile
AssetFiles are updated using the MERGE HTTP request.
| Method | Request URI | HTTP Version |
|---|---|---|
|
MERGE |
https://media.windows.net/API/Files('fileid') |
HTTP/1.1 |
Sample Request
MERGE https://media.windows.net/API/Files('nb:cid:UUID:2710e174-3165-a34c-96ad-618714b0d504') HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.1
Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=youraccountname&urn%3aSubscriptionId=2f84471d-b1ae-4e75-aa09-010f0fc0cf5b&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1337085302&Issuer=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&HMACSHA256=JFb4PJuWttPAft4dq9HaGl8Zw6hDN6mADhG3NaRi8Co%3d
Host: media.windows.net
Content-Length: 27
Expect: 100-continue
{"MimeType" : "video/mp4" }
Delete an AssetFile
AssetFiles are deleted when their associated Asset has been deleted. For an example, see Delete an Asset.
See Also
Concepts
ContentKeyAsset
AccessPolicies
Jobs
JobTemplates
Locators
MediaProcessors
Task
TaskTemplates
Other Resources
Media Services Considerations
Build Date:
Important