Skip to main content

opensocial.MediaItem

Method​

opensocial.MediaItem.getField​

String getField(key, opt_parmas)

Acquires data for the MediaItem linked to the specified key.

Parameter​
NameTypeDescription
keyStringKey for acquiring data. Refer to the Field class for possible values.
opt_paramsMap.Additional parameters passed on to requests
Return value​
TypeDescription
StringData
Sample​
var mimeType = mediaItem.getField(opensocial.MediaItem.Field.MIME_TYPE);

opensocial.MediaItem.setField​

setField(key, data)

Sets data in the MediaItem with the specified key.

Parameter​
NameTypeDescription
keyStringThe key to set in data
StringStringThe data to set
Return value​

None

Sample​
mediaItem.setField(opensocial.MediaItem.Field.MIME_TYPE, "image/jpeg");

opensocial.MediaItem.Field​

opensocial.MediaItem.Field.MIME_TYPE​

opensocial.MediaItem.Field.TYPE​

opensocial.MediaItem.Field.URL​

opensocial.MediaItem.Type.AUDIO​

opensocial.MediaItem.Type.IMAGE​

opensocial.MediaItem.Type.VIDEO​

Revision History​

  • 12/2010
    • Initial Release.