Opensocial.MediaItem (v0.9)

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 |

OpenSocial Tutorial

Building a complete social gadget from start to finish.

/wiki/spaces/a/pages/527151

Write a simple gift giving app using OpenSocial templates.

/wiki/spaces/a/pages/526845

Write a gift giving app which relies on an external server.

/wiki/spaces/a/pages/527088

Write a gift giving website which allows users to log in with OpenSocial accounts.

 

 

/wiki/spaces/a/pages/526897

Learn the basics of writing OpenSocial-based gadgets.

/wiki/spaces/a/pages/527038

Fetch social data from inside a gadget.

App Data

Read and write persistent data without needing a database.

 

 

Gadgets API Developers Guide

Learn the basics of writing non-social gadgets.

Gadgets XML Reference

Reference for the gadget specification XML.

Localization

Display locale-appropriate content based on the user's country and language settings.

/wiki/spaces/a/pages/527265

Render your gadget in different sections of the container.

 

 

/wiki/spaces/a/pages/527111

Fetch remote content.

Introduction To Signed Requests

Securely transmit OpenSocial IDs to a remote server.

Validating Signed Requests

Validate that information from a container has not been modified.

 

 

OpenSocial Templates

Simplify your display code by using templates.

 

 

/wiki/spaces/a/pages/526857

Access social data from your server.

Client Libraries

Use PHP, Java, Ruby, Python, and ActionScript or other languages to access social data.

 

 

Social Design Best Practices

Follow best practices for designing social applications.

Unobtrusive Alerts

Avoid the use of the UWC_TOKEN_START~1286243190737~UWC_TOKEN_END function.

Latency Measurement

Learn how to measure the latency and performance of your app.

Improving Latency

Reduce the latency of your app.

OAuth use cases

Learn how OpenSocial uses OAuth authorization.

Performance comparison on Programming Models

Including the comparison on first-time gadget rendering performance, and the data requesting performance.

 

 

OpenSocial Dev App

Experiment with social JavaScript calls inside of a social network.

OSDE Tutorial

Learn how to build social gadgets locally, using the OpenSocial Development Environment

Gadgets i18n Tool

Automatically translate gadgets using this Windows tool.

Partuza

An example social networking site based on PHP Shindig.

SocialSite

An example social networking site based on Java Shindig.

Silverlight Kit for MySpace

An Open Source Silverlight 2 Kit for the MySpace Developer Platform.

 

 

Google App Engine

Build an OpenSocial application using Google App Engine.

Amazon S3 and App Engine

Build a photo-sharing application on Amazon S3 and Google App Engine.

Google Data APIs

Access the Google Data APIs from a gadget, using the Google Accounts APIs for authentication.

Google Friend Connect

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) }}