Google Data APIs Client Library (1.41.1)



com.google.gdata.data.youtube
Class YouTubeMediaGroup

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.media.mediarss.MediaGroup
              extended by com.google.gdata.data.youtube.YouTubeMediaGroup
All Implemented Interfaces:
Extension

public class YouTubeMediaGroup
extends MediaGroup

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


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
AbstractExtension.AttributesHandler
 
Field Summary
 
Fields inherited from class com.google.gdata.data.ExtensionPoint
xmlBlob
 
Fields inherited from class com.google.gdata.data.AbstractExtension
localName, namespace
 
Constructor Summary
YouTubeMediaGroup()
           
 
Method Summary
 void addContent(MediaContent content)
          Adds a new MediaContent.
 void addContent(YouTubeMediaContent content)
          Adds a media:content tag.
 void addCredit(MediaCredit credit)
          Adds a new MediaCredit.
 void addCredit(YouTubeMediaCredit credit)
          Adds a media:credit tag.
 void addRating(MediaRating rating)
          Adds a new MediaRating.
 void addRating(YouTubeMediaRating rating)
          Adds a media:rating tag.
 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()
           
 java.util.List<MediaContent> getContents()
          Gets a read-only list of MediaContent.
 java.util.List<MediaCredit> getCredits()
          Gets a read-only list of MediaCredit.
 java.lang.Long getDuration()
          Gets the duration, in seconds, of the youtube video.
 java.util.List<MediaRating> getRatings()
          Gets a read-only list of MediaRating.
 DateTime getUploaded()
          Returns the time the video was uploaded at.
 java.lang.String getUploader()
          Gets the YouTube user who uploaded the video.
 YouTubeMediaCredit.Type getUploaderType()
          Checks whether the uploader is a partner.
 java.lang.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: YouTubeNamespace.CATEGORY_SCHEME and this method is a helper for retrieving it.
 java.util.List<YouTubeMediaContent> getYouTubeContents()
          Gets a modifiable list of YouTubeMediaContent.
 java.util.List<YouTubeMediaCredit> getYouTubeCredits()
          Gets a modifiable list of YouTubeMediaCredit.
 java.util.List<YouTubeMediaRating> getYouTubeRatings()
          Gets a modifiable list of YouTubeMediaRating.
 boolean isPrivate()
          Checks the yt:private flag.
 void setAspectRatio(YtAspectRatio aspectRatio)
           
 void setDuration(java.lang.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(java.lang.String uploader)
          Sets the YouTube user who uploaded the video.
 void setVideoId(java.lang.String videoId)
          Sets the YouTube video ID of the video.
 void setYouTubeCategory(java.lang.String name)
          Sets or changes the previously set YouTube category.
 
Methods inherited from class com.google.gdata.data.media.mediarss.MediaGroup
addCategory, addRestriction, addText, addThumbnail, clearCategories, clearRestrictions, clearTexts, clearThumbnails, getCategories, getCategoriesWithScheme, getCopyright, getDefaultDescription, getDescription, getHash, getKeywords, getPlayer, getRestrictions, getTexts, getThumbnails, getTitle, setCopyright, setDescription, setHash, setKeywords, setPlayer, setTitle
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getHandler, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren
 
Methods inherited from class com.google.gdata.data.AbstractExtension
consumeAttributes, disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gdata.data.Extension
generate, getHandler
 

Constructor Detail

YouTubeMediaGroup

public YouTubeMediaGroup()
Method Detail

getVideoId

public java.lang.String getVideoId()
Gets the YouTube ID of the video.

Since:
2.0

setVideoId

public void setVideoId(java.lang.String videoId)
Sets the YouTube video ID of the video.

Since:
2.0

getDuration

public java.lang.Long getDuration()
Gets the duration, in seconds, of the youtube video.


setDuration

public void setDuration(java.lang.Long seconds)
Sets the duration, in seconds, of the youtube video.


getUploaded

public DateTime getUploaded()
Returns the time the video was uploaded at.

Since:
2.0

setUploaded

public void setUploaded(DateTime dateTime)
Sets or unsets the time the video was uploaded at.

Since:
2.0

setUploader

public void setUploader(java.lang.String uploader)
Sets the YouTube user who uploaded the video.

Parameters:
uploader - YouTube user name or null
Since:
2.0

getUploader

public java.lang.String getUploader()
Gets the YouTube user who uploaded the video.

Returns:
YouTube user name or null
Since:
2.0

getUploaderType

public YouTubeMediaCredit.Type getUploaderType()
Checks whether the uploader is a partner.

Returns:
uploader type

getYouTubeContents

public java.util.List<YouTubeMediaContent> getYouTubeContents()
Gets a modifiable list of YouTubeMediaContent.

Returns:
list of MediaContent.

addContent

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.

Overrides:
addContent in class MediaGroup
Parameters:
content -
Throws:
java.lang.IllegalArgumentException - if content is not a YouTubeMediaContent

getContents

public java.util.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..

Overrides:
getContents in class MediaGroup
Returns:
a read-only collection of MediaContent

clearContents

public void clearContents()
Clears the list of media:content tags.

Overrides:
clearContents in class MediaGroup

addContent

public void addContent(YouTubeMediaContent content)
Adds a media:content tag.

Parameters:
content -

getYouTubeRatings

public java.util.List<YouTubeMediaRating> getYouTubeRatings()
Gets a modifiable list of YouTubeMediaRating.

Returns:
list of MediaRating.

addRating

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.

Overrides:
addRating in class MediaGroup
Parameters:
rating -
Throws:
java.lang.IllegalArgumentException - if rating is not a YouTubeMediaRating

getRatings

public java.util.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..

Overrides:
getRatings in class MediaGroup
Returns:
a read-only collection of MediaRating

clearRatings

public void clearRatings()
Clears the list of media:rating tags.

Overrides:
clearRatings in class MediaGroup

addRating

public void addRating(YouTubeMediaRating rating)
Adds a media:rating tag.

Parameters:
rating -

getYouTubeCredits

public java.util.List<YouTubeMediaCredit> getYouTubeCredits()
Gets a modifiable list of YouTubeMediaCredit.

Returns:
list of MediaCredit.

addCredit

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.

Overrides:
addCredit in class MediaGroup
Parameters:
credit -
Throws:
java.lang.IllegalArgumentException - if credit is not a YouTubeMediaCredit

getCredits

public java.util.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..

Overrides:
getCredits in class MediaGroup
Returns:
a read-only collection of MediaCredit

clearCredits

public void clearCredits()
Clears the list of media:credit tags.

Overrides:
clearCredits in class MediaGroup

addCredit

public void addCredit(YouTubeMediaCredit credit)
Adds a media:credit tag.

Parameters:
credit -

setAspectRatio

public void setAspectRatio(YtAspectRatio aspectRatio)

getAspectRatio

public YtAspectRatio getAspectRatio()

isPrivate

public boolean isPrivate()
Checks the yt:private flag.


setPrivate

public void setPrivate(boolean makePrivate)
Sets the yt:private flag.


getYouTubeCategory

public MediaCategory getYouTubeCategory()
A YouTube media group can have only one YouTube category defined by this scheme: YouTubeNamespace.CATEGORY_SCHEME and this method is a helper for retrieving it. See also: MediaGroup.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.

setYouTubeCategory

public void setYouTubeCategory(java.lang.String name)
Sets or changes the previously set YouTube category.

Parameters:
name - the new category name to set.

declareExtensions

public void declareExtensions(ExtensionProfile extProfile)
Declare extensions available in media:group on youtube feeds.

Overrides:
declareExtensions in class MediaGroup
Parameters:
extProfile - the ExtensionProfile to initialize.