public class

YouTubeMediaGroup

extends MediaGroup
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.media.mediarss.MediaGroup
         ↳ com.google.gdata.data.youtube.YouTubeMediaGroup

Class Overview

Subset of <media:group>. See description on http://search.yahoo.com/mrss.

Summary

Constants
String UPLOADER_ROLE
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
YouTubeMediaGroup()
Public Methods
void addContent(YouTubeMediaContent content)
Adds a media:content tag.
void addContent(MediaContent content)
Adds a new MediaContent.
void addCredit(YouTubeMediaCredit credit)
Adds a media:credit tag.
void addCredit(MediaCredit credit)
Adds a new MediaCredit.
void addRating(YouTubeMediaRating rating)
Adds a media:rating tag.
void addRating(MediaRating rating)
Adds a new MediaRating.
void clearContents()
Clears the list of media:content tags.
void clearCredits()
Clears the list of media:credit tags.
void clearRatings()
Clears the list of media:rating tags.
void declareExtensions(ExtensionProfile extProfile)
Declare extensions available in media:group on youtube feeds.
YtAspectRatio getAspectRatio()
List<MediaContent> getContents()
Gets a read-only list of MediaContent.
List<MediaCredit> getCredits()
Gets a read-only list of MediaCredit.
Long getDuration()
Gets the duration, in seconds, of the youtube video.
List<MediaRating> getRatings()
Gets a read-only list of MediaRating.
DateTime getUploaded()
Returns the time the video was uploaded at.
String getUploader()
Gets the YouTube user who uploaded the video.
YouTubeMediaCredit.Type getUploaderType()
Checks whether the uploader is a partner.
String getVideoId()
Gets the YouTube ID of the video.
MediaCategory getYouTubeCategory()
A YouTube media group can have only one YouTube category defined by this scheme: CATEGORY_SCHEME and this method is a helper for retrieving it.
List<YouTubeMediaContent> getYouTubeContents()
Gets a modifiable list of YouTubeMediaContent.
List<YouTubeMediaCredit> getYouTubeCredits()
Gets a modifiable list of YouTubeMediaCredit.
List<YouTubeMediaRating> getYouTubeRatings()
Gets a modifiable list of YouTubeMediaRating.
boolean isPrivate()
Checks the yt:private flag.
void setAspectRatio(YtAspectRatio aspectRatio)
void setDuration(Long seconds)
Sets the duration, in seconds, of the youtube video.
void setPrivate(boolean makePrivate)
Sets the yt:private flag.
void setUploaded(DateTime dateTime)
Sets or unsets the time the video was uploaded at.
void setUploader(String uploader)
Sets the YouTube user who uploaded the video.
void setVideoId(String videoId)
Sets the YouTube video ID of the video.
void setYouTubeCategory(String name)
Sets or changes the previously set YouTube category.
[Expand]
Inherited Methods
From class com.google.gdata.data.media.mediarss.MediaGroup
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

private static final String UPLOADER_ROLE

Constant Value: "uploader"

Public Constructors

public YouTubeMediaGroup ()

Public Methods

public void addContent (YouTubeMediaContent content)

Adds a media:content tag.

Parameters
content

public void addContent (MediaContent content)

Adds a new MediaContent. YouTube entries can only contain YouTubeMediaContent and this method checks that at runtime. Please use addContent(YouTubeMediaContent) instead.

Parameters
content
Throws
IllegalArgumentException if content is not a YouTubeMediaContent

public void addCredit (YouTubeMediaCredit credit)

Adds a media:credit tag.

Parameters
credit

public void addCredit (MediaCredit credit)

Adds a new MediaCredit. YouTube entries can only contain YouTubeMediaCredit and this method checks that at runtime. Please use addCredit(YouTubeMediaCredit) instead.

Parameters
credit
Throws
IllegalArgumentException if credit is not a YouTubeMediaCredit

public void addRating (YouTubeMediaRating rating)

Adds a media:rating tag.

Parameters
rating

public void addRating (MediaRating rating)

Adds a new MediaRating. YouTube entries can only contain YouTubeMediaRating and this method checks that at runtime. Please use addRating(YouTubeMediaRating) instead.

Parameters
rating
Throws
IllegalArgumentException if rating is not a YouTubeMediaRating

public void clearContents ()

Clears the list of media:content tags.

public void clearCredits ()

Clears the list of media:credit tags.

public void clearRatings ()

Clears the list of media:rating tags.

public void declareExtensions (ExtensionProfile extProfile)

Declare extensions available in media:group on youtube feeds.

Parameters
extProfile The ExtensionProfile to initialize.

public YtAspectRatio getAspectRatio ()

public List<MediaContent> getContents ()

Gets a read-only list of MediaContent. YouTube entries only contain YouTubeMediaContent. Please use getYouTubeContents() instead to make sure you have access to a modifiable lis. This collection has been made read-only to make sure only YouTubeMediaContent are ever added. Please use getYouTubeContents()/addContent(YouTubeMediaContent) to modify the list of media:content tags..

Returns
  • a read-only collection of MediaContent

public List<MediaCredit> getCredits ()

Gets a read-only list of MediaCredit. YouTube entries only contain YouTubeMediaCredit. Please use getYouTubeCredits() instead to make sure you have access to a modifiable lis. This collection has been made read-only to make sure only YouTubeMediaCredit are ever added. Please use getYouTubeCredits()/addCredit(YouTubeMediaCredit) to modify the list of media:credit tags..

Returns
  • a read-only collection of MediaCredit

public Long getDuration ()

Gets the duration, in seconds, of the youtube video.

public List<MediaRating> getRatings ()

Gets a read-only list of MediaRating. YouTube entries only contain YouTubeMediaRating. Please use getYouTubeRatings() instead to make sure you have access to a modifiable lis. This collection has been made read-only to make sure only YouTubeMediaRating are ever added. Please use getYouTubeRatings()/addRating(YouTubeMediaRating) to modify the list of media:rating tags..

Returns
  • a read-only collection of MediaRating

public DateTime getUploaded ()

Returns the time the video was uploaded at.

public String getUploader ()

Gets the YouTube user who uploaded the video.

Returns
  • YouTube user name or null

public YouTubeMediaCredit.Type getUploaderType ()

Checks whether the uploader is a partner.

Returns
  • uploader type

public String getVideoId ()

Gets the YouTube ID of the video.

public MediaCategory getYouTubeCategory ()

A YouTube media group can have only one YouTube category defined by this scheme: CATEGORY_SCHEME and this method is a helper for retrieving it. See also: getCategories().

If two or more such categories are specified it cannot be determined which is the right one so this method will return null.

Returns
  • the YouTube category of this video, if such a category cannot be found or determined it returns null.

public List<YouTubeMediaContent> getYouTubeContents ()

Gets a modifiable list of YouTubeMediaContent.

Returns
  • list of MediaContent.

public List<YouTubeMediaCredit> getYouTubeCredits ()

Gets a modifiable list of YouTubeMediaCredit.

Returns
  • list of MediaCredit.

public List<YouTubeMediaRating> getYouTubeRatings ()

Gets a modifiable list of YouTubeMediaRating.

Returns
  • list of MediaRating.

public boolean isPrivate ()

Checks the yt:private flag.

public void setAspectRatio (YtAspectRatio aspectRatio)

Parameters
aspectRatio

public void setDuration (Long seconds)

Sets the duration, in seconds, of the youtube video.

Parameters
seconds

public void setPrivate (boolean makePrivate)

Sets the yt:private flag.

Parameters
makePrivate

public void setUploaded (DateTime dateTime)

Sets or unsets the time the video was uploaded at.

Parameters
dateTime

public void setUploader (String uploader)

Sets the YouTube user who uploaded the video.

Parameters
uploader YouTube user name or null

public void setVideoId (String videoId)

Sets the YouTube video ID of the video.

Parameters
videoId

public void setYouTubeCategory (String name)

Sets or changes the previously set YouTube category.

Parameters
name The new category name to set.