The fm:FileInfo component allows you to get all the information for a specific file (media) in your application.
The following example shows the title, rating, approved comments and not denied comments for a specified media id, which is passed as mid.
Title: {$$media.title
Rating {$$media.rating
Approved comments {$$media.approvedcomments
Not Denied Comments {$$media.notdeniedcomments
Name | Required | Default | Description |
---|---|---|---|
dateFormat | Optional | %Y-%m-%d %H:%i:%s | This attribute allows you to change the way dates are displayed within the list. By default it will be YYYY-MM-DD HH:MM:SS. The format which should be used is the same as PHP's date() function. |
includeConversionInfo | Optional | N/A | If set, this will return a conversion information array |
mediaVar | Optional | N/A | |
mid | Required | N/A | |
noCache | Optional | N/A | If set cache on this call will be disabled - rarely needed |
Name | Description |
---|---|
media.approvedcomments | The total number of approved comments for this file. |
media.notdeniedcomments | The number of comments that have not been denied for this file. |
media.channel | The channel-id if the file was associated to a channel. |
media.channel_name | The name of the channel if the file was associated to a channel. |
media.channel_shortname | The 'shortname' of the channel if the file was associated to a channel. |
media.contenttype | The mimetype of the file, for example: audio/mp3. |
media.conversiontime | The time needed to transcode the file, in seconds. |
media.converttime | The date and time when the transcoding was completed for this file. |
media.commentcount | The total number of comments to this file. |
media.date | The original creation date of the file. If we cannot detect this, this will be the same as the upload date. |
media.duration | The duration of the file in a human-readable format (example: 00:01:07). |
media.extension | The original file extension, for example 'mp4' |
media.filetype | The filetype. This is specified as a number between 1 and 4. Read below for more information. |
media.filename | The original filename |
media.filesize | The size of the file, in bytes. |
media.height | The height of the original file in pixels. |
media.hits | The number of views the file got. |
media.id | The unique id of the file. |
media.injector | A string describing the application that created the file, for example Uploader or Recorder. |
media.length | The duration of the file in as a floating point number in seconds. (example: 187.33, for 3 minutes, 7 seconds) |
media.message | The description of the file. |
media.metadata | User-defined or developer-defined meta-data for the media; the metadata can be defined in the mediadetail page (by the user) or in the API (by the developer). In the FileInfo Component, its values can be read as: media.metadata.user.<key> Examples of keys are
|
media.ofilesize | The total size of all transcoded versions of this file, including thumbnails in bytes. |
media.publicUrl | The base-url associated with the file. See below for more information. |
media.rating | The average rating. This is a floating point number between 0 and 10. 2 decimals are provided. |
media.status | The status of the file. Generally this is always 3, meaning 'succesfully converted'. |
media.moderationStatus | The moderation status of the file. |
media.title | The title of the file. |
media.tags | A space delimited list of tags associated with the file. For example "amsterdam holiday". |
media.uid | The id of the user who uploaded the file. |
media.updownrating | This template variable will give you the "thumbs up/down" rating. The actual formula is actually based on the votecount and average rating, and assumes people rate 0 for down, and 10 for up. |
media.upload | The date and time the file was added to the Media Factory. |
media.uploadage | The time that has passed since the file was uploaded. The format will be for example 5 seconds, 20 minutes or 12 days. |
media.user_city | The submitter's city. |
media.user_country | The submitter's 2-letter country code. |
media.user_firstname | The submitter's first name. |
media.user_lastname | The submitter's last name. |
media.user_name | The username of the person uploading the file. |
media.user_nickname | The submitter's nickname. |
media.user_state | The 2-letter state or province code of the submitter. |
media.votecount | The total number of votes cast. |
media.width | The width of the original file in pixels. |
media.geo_latitude | The latitude of the file if available, otherwise empty. |
media.geo_longitude | The longitude of the file if available, otherwise empty. |
media.author | This field is used to retrieve the name entered by an anonymous user. Often used when users can comment without registering, by a captcha. |
media.conversions | This is an array of conversions and their status. eg. media.conversions.15 will return 3 if converted successfully |
The following code shows the title and metadata for a media with the mid being specified by {$$get.mid}.
Title: {$$media.title}
Rating {$$media.rating}
Metadata User Synopsis {$$media.metadata.user.synopsis}
Metadata User Pin {$$media.metadata.user.pin}