public class MediaItemsService extends Service
| Constructor and Description |
|---|
MediaItemsService() |
| Modifier and Type | Method and Description |
|---|---|
static Request |
createMediaItem(MediaItem item)
Returns a new Request instance which, when submitted, creates a new
media item in the specified viewer album.
|
static Request |
deleteMediaItem(String itemId,
String albumId)
Returns a new Request instance which, when submitted, deletes an existing
media item from the specified viewer album.
|
static Request |
getMediaItem(String itemId,
String albumId)
Returns a new Request instance which, when submitted, fetches the
specified media item from the specified album and makes this data
available as a MediaItem object.
|
static Request |
getMediaItems(String albumId)
Returns a new Request instance which, when submitted, fetches the current
viewer's media items from the specified album and makes this data
available as a List of MediaItem objects.
|
static Request |
getSupportedVideoCategories()
Returns a new Request instance which, when submitted, fetches all video
categories supported by the container and makes this data available as a
JSON array of JSON objects; currently works with MySpace only.
|
static Request |
updateMediaItem(MediaItem item)
Returns a new Request instance which, when submitted, updates an existing
media item contained within the specified viewer album.
|
static Request |
uploadImage(MediaItem item,
File content)
Returns a new Request instance which, when submitted, uploads the
specified image file as a new media item in the specified viewer album.
|
static Request |
uploadVideo(MediaItem item,
File content)
Returns a new Request instance which, when submitted, uploads the
specified video file as a new media item in the specified viewer album
("@videos" for MySpace).
|
public static Request getMediaItems(String albumId)
albumId - ID of album whose media item contents are to fetchedMediaItempublic static Request getMediaItem(String itemId, String albumId)
itemId - ID of media item to fetchalbumId - ID of album containing media item to fetchMediaItempublic static Request getSupportedVideoCategories()
public static Request createMediaItem(MediaItem item) throws RequestException
item - MediaItem object specifying the media item parameters to
pass into the request; album_id must be set and other
properties, e.g. type and url, can also be setRequestException - if the passed MediaItem object does not have an
album_id property setpublic static Request uploadImage(MediaItem item, File content) throws RequestException, IOException
item - MediaItem object specifying the media item parameters to
pass into the request; album_id and mime_type must be setcontent - local image file to be uploaded as a new media itemRequestException - if the passed MediaItem object does not have its
album_id or mime_type properties setIOException - if an I/O error occurs while reading the passed
filepublic static Request uploadVideo(MediaItem item, File content) throws RequestException, IOException
item - MediaItem object specifying the media item parameters to
pass into the request; album_id and mime_type must be set,
and MySpace also requires caption, description, tags,
msCategories, and languagecontent - local video file to be uploaded as a new media itemRequestException - if the passed MediaItem object does not have its
album_id or mime_type properties setIOException - if an I/O error occurs while reading the passed
filepublic static Request updateMediaItem(MediaItem item) throws RequestException
item - MediaItem object specifying the media item parameters to pass
into the request; id and album_id must be set in order to
specify which media item to update and values associated
with any other property, e.g. type and url, are updatedRequestException - if the passed MediaItem object does not have both
id and album_id properties setpublic static Request deleteMediaItem(String itemId, String albumId)
itemId - ID of media item to deletealbumId - ID of album containing media item to deleteCopyright © 2012. All Rights Reserved.