Opensocial.MediaItem (v0.9)

From VZ Developer Wiki
Jump to: navigation, search

This documentation is not completed yet and will be extended by more examples in future.

opensocial.MediaItem

Represents images, movies, and audio. Create a MediaItem object using the opensocial.newMediaItem() method.

Methods

opensocial.MediaItem.getField

String getField(key, opt_params)
Parameters
Name Type Description
key String The key to get data for; see the Field class for possible values
opt_params Map.<opensocial.DataRequest.DataRequestFields|Object> Additional params to pass to the request.
Returns
Type Description
String The data
Description
Gets the media item data that's associated with the specified key.

opensocial.MediaItem.setField

setField(key, data)
Parameters
Name Type Description
key String The key to set data for
data String The data to set
Description
Sets data for this media item associated with the given key.

opensocial.MediaItem.Field

All of the fields that media items have. See also: opensocial.MediaItem.getField()

opensocial.MediaItem.Field.ALBUM_ID

string, album to which the media item belongs This field may be used interchangeably with the string 'albumId'.

opensocial.MediaItem.Field.CREATED

string, creation time associated with the media item - assigned by container in UTC This field may be used interchangeably with the string 'created'.

opensocial.MediaItem.Field.DESCRIPTION

string, description of the media item This field may be used interchangeably with the string 'description'.

opensocial.MediaItem.Field.DURATION

integer, for audio/video clips - playtime length in seconds. set to -1/not defined if unknown This field may be used interchangeably with the string 'duration'.

opensocial.MediaItem.Field.FILE_SIZE

long, number of bytes (set to -1/undefined if unknown). This field may be used interchangeably with the string 'fileSize'.

opensocial.MediaItem.Field.ID

string, id Associated with the media item This field may be used interchangeably with the string 'id'.

opensocial.MediaItem.Field.LANGUAGE

string, language associated with the media item in ISO 639-3 format This field may be used interchangeably with the string 'language'.

opensocial.MediaItem.Field.LAST_UPDATED

string, update time associated with the media item - assigned by container in UTC This field may be used interchangeably with the string 'lastUpdated'.

opensocial.MediaItem.Field.LOCATION

opensocial.Address, location corresponding to the media item This field may be used interchangeably with the string 'location'.

opensocial.MediaItem.Field.MIME_TYPE

The MIME type of media, specified as a string. This field may be used interchangeably with the string 'mimeType'.

opensocial.MediaItem.Field.NUM_COMMENTS

integer, number of comments on the photo. This field may be used interchangeably with the string 'numComments'.

opensocial.MediaItem.Field.NUM_VIEWS

integer, number of views for the media item. This field may be used interchangeably with the string 'numViews'.

opensocial.MediaItem.Field.NUM_VOTES

integer, number of votes received for voting. This field may be used interchangeably with the string 'numVotes'.

opensocial.MediaItem.Field.RATING

integer, average rating of the media item on a scale of 0-10. This field may be used interchangeably with the string 'rating'.

opensocial.MediaItem.Field.START_TIME

string, for streaming/live content, time when the content is available. This field may be used interchangeably with the string 'startTime'.

opensocial.MediaItem.Field.TAGGED_PEOPLE

<static> Member of: opensocial.MediaItem.Field.TAGGED_PEOPLE array of strings, array of string (IDs) of people tagged in the media item This field may be used interchangeably with the string 'taggedPeople'.

opensocial.MediaItem.Field.TAGS

array of strings, tags associated with this media item. This field may be used interchangeably with the string 'tags'.

opensocial.MediaItem.Field.THUMBNAIL_URL

<static> Member of: opensocial.MediaItem.Field.THUMBNAIL_URL string, URL to a thumbnail image of the media item This field may be used interchangeably with the string 'thumbnailUrl'.

opensocial.MediaItem.Field.TITLE

string describing the media item This field may be used interchangeably with the string 'title'.

opensocial.MediaItem.Field.TYPE

The type of media, specified as a MediaItem.Type object. This field may be used interchangeably with the string 'type'.

opensocial.MediaItem.Field.URL

A string specifying the URL where the media can be found. This field may be used interchangeably with the string 'url'.

opensocial.MediaItem.Type

The possible types of media items. See also: opensocial.MediaItem.Field

opensocial.MediaItem.Type.AUDIO

This field may be used interchangeably with the string 'audio'.

opensocial.MediaItem.Type.IMAGE

This field may be used interchangeably with the string 'image'.

opensocial.MediaItem.Type.VIDEO

This field may be used interchangeably with the string 'video'.



OpenSocial (v0.9)

gadgets

gadgets.io

gadgets.json

gadgets.Prefs

gadgets.util

gadgets.views

gadgets.flash

gadgets.MiniMessage

gadgets.oauth.Popup

gadgets.rpc

gadgets.skins

gadgets.pubsub

gadgets.Tab

gadgets.TabSet

gadgets.window

gadgets.i18n

opensocial

opensocial.Activity

opensocial.Address

opensocial.Album

opensocial.BodyType

opensocial.Collection

opensocial.CreateActivityPriority

opensocial.DataRequest

opensocial.DataResponse

opensocial.Email

opensocial.Enum

opensocial.Environment

opensocial.EscapeType

opensocial.IdSpec

opensocial.MediaItem

opensocial.Message

opensocial.MessageCollection

opensocial.Name

opensocial.NavigationParameters

opensocial.Organization

opensocial.Permission

opensocial.Person

opensocial.Phone

opensocial.ResponseItem

opensocial.Url

osapi.Request

osapi.BatchRequest

osapi.people

osapi.activities

osapi.appdata

osapi.messages

osapi.http