com.sun.syndication.feed.module.mediarss.types
Class MediaContent

java.lang.Object
  extended by com.sun.syndication.feed.module.mediarss.types.MediaContent
All Implemented Interfaces:
java.io.Serializable

public class MediaContent
extends java.lang.Object
implements java.io.Serializable

<media:content>

<media:content> is a sub-element of either <item> or <media:group>. Media objects that are not the same content should not be included in the same <media:group> element. The sequence of these items implies the order of presentation. While many of the attributes appear to be audio/video specific, this element can be used to publish any type of media. It contains 14 attributes, most of which are optional.

        <media:content
               url="http://www.foo.com/movie.mov"
               fileSize="12216320"
               type="video/quicktime"
               medium="video"
               isDefault="true"
               expression="full"
               bitrate="128"
               framerate="25"
               samplingrate="44.1"
               channels="2"
               duration="185"
               height="200"
               width="300"
               lang="en" />

url should specify the direct url to the media object. If not included, a <media:player> element must be specified.

fileSize is the number of bytes of the media object. It is an optional attribute.

type is the standard MIME type of the object. It is an optional attribute.

medium is the type of object (image | audio | video | document | executable). While this attribute can at times seem redundant if type is supplied, it is included because it simplifies decision making on the reader side, as well as flushes out any ambiguities between MIME type and object type. It is an optional attribute.

isDefault determines if this is the default object that should be used for the <media:group>. There should only be one default object per <media:group>. It is an optional attribute.

expression determines if the object is a sample or the full version of the object, or even if it is a continuous stream (sample | full | nonstop). Default value is 'full'. It is an optional attribute.

bitrate is the kilobits per second rate of media. It is an optional attribute.

framerate is the number of frames per second for the media object. It is an optional attribute.

samplingrate is the number of samples per second taken to create the media object. It is expressed in thousands of samples per second (kHz). It is an optional attribute.

channels is number of audio channels in the media object. It is an optional attribute.

duration is the number of seconds the media object plays. It is an optional attribute.

height is the height of the media object. It is an optional attribute.

width is the width of the media object. It is an optional attribute.

lang is the primary language encapsulated in the media object. Language codes possible are detailed in RFC 3066. This attribute is used similar to the xml:lang attribute detailed in the XML 1.0 Specification (Third Edition). It is an optional attribute.

These optional attributes, along with the optional elements below, contain the primary metadata entries needed to index and organize media content. Additional supported attributes for describing images, audio, and video may be added in future revisions of this document.

Author:
Nathanial X. Freitas MediaContent corresponds to the element defined within the MediaRSS specification. There may be one or more instances within each instance of an within an RSS 2.0 document.
See Also:
Serialized Form

Constructor Summary
MediaContent(Reference reference)
          Creates a new MediaContent
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Integer getAudioChannels()
          channels is number of audio channels in the media object.
 java.lang.Float getBitrate()
          bitrate is the kilobits per second rate of media.
 java.lang.Long getDuration()
          duration is the number of seconds the media object plays.
 Expression getExpression()
          expression determines if the object is a sample or the full version of the object, or even if it is a continuous stream (sample | full | nonstop).
 java.lang.Long getFileSize()
          fileSize is the number of bytes of the media object.
 java.lang.Float getFramerate()
          framerate is the number of frames per second for the media object.
 java.lang.Integer getHeight()
          height is the height of the media object.
 java.lang.String getLanguage()
          lang is the primary language encapsulated in the media object.
 Metadata getMetadata()
          The metadata for the item
 PlayerReference getPlayer()
          <media:player>
 Reference getReference()
          The player or URL reference for the item
 java.lang.Float getSamplingrate()
          samplingrate is the number of samples per second taken to create the media object.
 java.lang.String getType()
          type is the standard MIME type of the object.
 java.lang.Integer getWidth()
          width is the width of the media object.
 int hashCode()
           
 boolean isDefaultContent()
          isDefault determines if this is the default object that should be used for the .
 void setAudioChannels(java.lang.Integer audioChannels)
          channels is number of audio channels in the media object.
 void setBitrate(java.lang.Float bitrate)
          bitrate is the kilobits per second rate of media.
 void setDefaultContent(boolean defaultContent)
          isDefault determines if this is the default object that should be used for the .
 void setDuration(java.lang.Long duration)
          duration is the number of seconds the media object plays.
 void setExpression(Expression expression)
          expression determines if the object is a sample or the full version of the object, or even if it is a continuous stream (sample | full | nonstop).
 void setFileSize(java.lang.Long fileSize)
          fileSize is the number of bytes of the media object.
 void setFramerate(java.lang.Float framerate)
          framerate is the number of frames per second for the media object.
 void setHeight(java.lang.Integer height)
          height is the height of the media object.
 void setLanguage(java.lang.String language)
          lang is the primary language encapsulated in the media object.
 void setMetadata(Metadata metadata)
          The metadata for the item
 void setPlayer(PlayerReference player)
          <media:player>
 void setReference(Reference reference)
          The player or URL reference for the item
 void setSamplingrate(java.lang.Float samplingrate)
          samplingrate is the number of samples per second taken to create the media object.
 void setType(java.lang.String type)
          type is the standard MIME type of the object.
 void setWidth(java.lang.Integer width)
          width is the width of the media object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MediaContent

public MediaContent(Reference reference)
Creates a new MediaContent

Parameters:
reference - UrlReference or Player reference for the item.
Method Detail

setAudioChannels

public void setAudioChannels(java.lang.Integer audioChannels)
channels is number of audio channels in the media object. It is an optional attribute.

Parameters:
audioChannels - channels is number of audio channels in the media object. It is an optional attribute.

getAudioChannels

public java.lang.Integer getAudioChannels()
channels is number of audio channels in the media object. It is an optional attribute.

Returns:
channels is number of audio channels in the media object. It is an optional attribute.

setBitrate

public void setBitrate(java.lang.Float bitrate)
bitrate is the kilobits per second rate of media. It is an optional attribute.

Parameters:
bitrate - bitrate is the kilobits per second rate of media. It is an optional attribute.

getBitrate

public java.lang.Float getBitrate()
bitrate is the kilobits per second rate of media. It is an optional attribute.

Returns:
bitrate is the kilobits per second rate of media. It is an optional attribute.

setDefaultContent

public void setDefaultContent(boolean defaultContent)
isDefault determines if this is the default object that should be used for the . There should only be one default object per . It is an optional attribute.

Parameters:
defaultContent - isDefault determines if this is the default object that should be used for the . There should only be one default object per . It is an optional attribute.

isDefaultContent

public boolean isDefaultContent()
isDefault determines if this is the default object that should be used for the . There should only be one default object per . It is an optional attribute.

Returns:
isDefault determines if this is the default object that should be used for the . There should only be one default object per . It is an optional attribute.

setDuration

public void setDuration(java.lang.Long duration)
duration is the number of seconds the media object plays. It is an optional attribute.

Parameters:
duration - duration is the number of seconds the media object plays. It is an optional attribute.

getDuration

public java.lang.Long getDuration()
duration is the number of seconds the media object plays. It is an optional attribute.

Returns:
duration is the number of seconds the media object plays. It is an optional attribute.

setExpression

public void setExpression(Expression expression)
expression determines if the object is a sample or the full version of the object, or even if it is a continuous stream (sample | full | nonstop). Default value is 'full'. It is an optional attribute.

Parameters:
expression - expression determines if the object is a sample or the full version of the object, or even if it is a continuous stream (sample | full | nonstop). Default value is 'full'. It is an optional attribute.

getExpression

public Expression getExpression()
expression determines if the object is a sample or the full version of the object, or even if it is a continuous stream (sample | full | nonstop). Default value is 'full'. It is an optional attribute.

Returns:
expression determines if the object is a sample or the full version of the object, or even if it is a continuous stream (sample | full | nonstop). Default value is 'full'. It is an optional attribute.

setFileSize

public void setFileSize(java.lang.Long fileSize)
fileSize is the number of bytes of the media object. It is an optional attribute.

Parameters:
fileSize - The fileSize to set.

getFileSize

public java.lang.Long getFileSize()
fileSize is the number of bytes of the media object. It is an optional attribute.

Returns:
Returns the fileSize.

setFramerate

public void setFramerate(java.lang.Float framerate)
framerate is the number of frames per second for the media object. It is an optional attribute.

Parameters:
framerate - framerate is the number of frames per second for the media object. It is an optional attribute.

getFramerate

public java.lang.Float getFramerate()
framerate is the number of frames per second for the media object. It is an optional attribute.

Returns:
framerate is the number of frames per second for the media object. It is an optional attribute.

setHeight

public void setHeight(java.lang.Integer height)
height is the height of the media object. It is an optional attribute.

Parameters:
height - height is the height of the media object. It is an optional attribute.

getHeight

public java.lang.Integer getHeight()
height is the height of the media object. It is an optional attribute.

Returns:
height is the height of the media object. It is an optional attribute.

setLanguage

public void setLanguage(java.lang.String language)
lang is the primary language encapsulated in the media object. Language codes possible are detailed in RFC 3066. This attribute is used similar to the xml:lang attribute detailed in the XML 1.0 Specification (Third Edition). It is an optional attribute.

Parameters:
language - lang is the primary language encapsulated in the media object. Language codes possible are detailed in RFC 3066. This attribute is used similar to the xml:lang attribute detailed in the XML 1.0 Specification (Third Edition). It is an optional attribute.

getLanguage

public java.lang.String getLanguage()
lang is the primary language encapsulated in the media object. Language codes possible are detailed in RFC 3066. This attribute is used similar to the xml:lang attribute detailed in the XML 1.0 Specification (Third Edition). It is an optional attribute.

Returns:
lang is the primary language encapsulated in the media object. Language codes possible are detailed in RFC 3066. This attribute is used similar to the xml:lang attribute detailed in the XML 1.0 Specification (Third Edition). It is an optional attribute.

setMetadata

public void setMetadata(Metadata metadata)
The metadata for the item

Parameters:
metadata - The metadata for the item

getMetadata

public Metadata getMetadata()
The metadata for the item

Returns:
The metadata for the item

setPlayer

public void setPlayer(PlayerReference player)
<media:player>

Allows the media object to be accessed through a web browser media player console. This element is required only if a direct media url attribute is not specified in the <media:content> element. It has 1 required attribute, and 2 optional attributes.

        <media:player url="http://www.foo.com/player?id=1111" height="200" width="400" />

url is the url of the player console that plays the media. It is a required attribute.

height is the height of the browser window that the url should be opened in. It is an optional attribute.

width is the width of the browser window that the url should be opened in. It is an optional attribute.

Parameters:
player - PlayerReference for the item.

getPlayer

public PlayerReference getPlayer()
<media:player>

Allows the media object to be accessed through a web browser media player console. This element is required only if a direct media url attribute is not specified in the <media:content> element. It has 1 required attribute, and 2 optional attributes.

        <media:player url="http://www.foo.com/player?id=1111" height="200" width="400" />

url is the url of the player console that plays the media. It is a required attribute.

height is the height of the browser window that the url should be opened in. It is an optional attribute.

width is the width of the browser window that the url should be opened in. It is an optional attribute.

Returns:
PlayerReference for the item.

setReference

public void setReference(Reference reference)
The player or URL reference for the item

Parameters:
reference - The player or URL reference for the item

getReference

public Reference getReference()
The player or URL reference for the item

Returns:
The player or URL reference for the item

setSamplingrate

public void setSamplingrate(java.lang.Float samplingrate)
samplingrate is the number of samples per second taken to create the media object. It is expressed in thousands of samples per second (kHz). It is an optional attribute.

Parameters:
samplingrate - samplingrate is the number of samples per second taken to create the media object. It is expressed in thousands of samples per second (kHz). It is an optional attribute.

getSamplingrate

public java.lang.Float getSamplingrate()
samplingrate is the number of samples per second taken to create the media object. It is expressed in thousands of samples per second (kHz). It is an optional attribute.

Returns:
samplingrate is the number of samples per second taken to create the media object. It is expressed in thousands of samples per second (kHz). It is an optional attribute.

setType

public void setType(java.lang.String type)
type is the standard MIME type of the object. It is an optional attribute.

Parameters:
type - The type to set.

getType

public java.lang.String getType()
type is the standard MIME type of the object. It is an optional attribute.

Returns:
Returns the type.

setWidth

public void setWidth(java.lang.Integer width)
width is the width of the media object. It is an optional attribute.

Parameters:
width - width is the width of the media object. It is an optional attribute.

getWidth

public java.lang.Integer getWidth()
width is the width of the media object. It is an optional attribute.

Returns:
width is the width of the media object. It is an optional attribute.

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006-2009. All Rights Reserved.