opensocial.MediaItem
Method
opensocial.MediaItem.getField
String getField(key, opt_parmas)
Acquires data for the MediaItem linked to the specified key.
Parameter
| Name | Type | Description |
|---|---|---|
| key | String | Key for acquiring data. Refer to the Field class for possible values. |
| opt_params | Map. | Additional parameters passed on to requests |
Return value
| Type | Description |
|---|---|
| String | Data |
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
| Name | Type | Description |
|---|---|---|
| key | String | The key to set in data |
| String | String | The 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.