NeedsExamples
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
NameTypeDescription |
Building a complete social gadget from start to finish. |
|||
Write a simple gift giving app using OpenSocial templates. |
|||
Write a gift giving app which relies on an external server. |
|||
Write a gift giving website which allows users to log in with OpenSocial accounts. |
|||
|
|
||
Learn the basics of writing OpenSocial-based gadgets. |
|||
Fetch social data from inside a gadget. |
|||
Read and write persistent data without needing a database. |
|||
|
|
||
Learn the basics of writing non-social gadgets. |
|||
Reference for the gadget specification XML. |
|||
Display locale-appropriate content based on the user's country and language settings. |
|||
Render your gadget in different sections of the container. |
|||
|
|
||
Fetch remote content. |
|||
Securely transmit OpenSocial IDs to a remote server. |
|||
Validate that information from a container has not been modified. |
|||
|
|
||
Simplify your display code by using templates. |
|||
|
|
||
Access social data from your server. |
|||
Use PHP, Java, Ruby, Python, and ActionScript or other languages to access social data. |
|||
|
|
||
Follow best practices for designing social applications. |
|||
Avoid the use of the UWC_TOKEN_START~1286243190737~UWC_TOKEN_END function. |
|||
Learn how to measure the latency and performance of your app. |
|||
Reduce the latency of your app. |
|||
Learn how OpenSocial uses OAuth authorization. |
|||
Including the comparison on first-time gadget rendering performance, and the data requesting performance. |
|
|
|
Experiment with social JavaScript calls inside of a social network. |
|||
Learn how to build social gadgets locally, using the OpenSocial Development Environment |
|||
Automatically translate gadgets using this Windows tool. |
|||
An example social networking site based on PHP Shindig. |
|||
An example social networking site based on Java Shindig. |
|||
An Open Source Silverlight 2 Kit for the MySpace Developer Platform. |
|||
|
|
||
Build an OpenSocial application using Google App Engine. |
|||
Build a photo-sharing application on Amazon S3 and Google App Engine. |
|||
Access the Google Data APIs from a gadget, using the Google Accounts APIs for authentication. |
|||
Integrate OpenSocial and Google Friend Connect on your PHP website. |
|||
|
|
||
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
TypeDescription |
String |
The data |
Description
Gets the media item data that's associated with the specified key.
opensocial.MediaItem.setField
;setField(key, data)
Parameters
NameTypeDescription |
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'.
{{ JsApiAlphaList_(v0.9) }}