Class MediaContent

  • All Implemented Interfaces:
    Serializable

    public class MediaContent
    extends Object
    implements 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.

    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 Detail

      • MediaContent

        public MediaContent​(Reference reference)
        Parameters:
        reference - UrlReference or Player reference for the item.
    • Method Detail

      • setAudioChannels

        public void setAudioChannels​(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 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​(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 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​(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 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​(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 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​(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 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​(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 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​(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 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.
      • setMedium

        public void setMedium​(String newmedium)
        Set the value of medium
        Parameters:
        newmedium - new value of medium
      • getMedium

        public String getMedium()
        Get the value of medium
        Returns:
        the value of medium
      • 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​(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 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​(String type)
        type is the standard MIME type of the object. It is an optional attribute.
        Parameters:
        type - The type to set.
      • getType

        public String getType()
        type is the standard MIME type of the object. It is an optional attribute.
        Returns:
        Returns the type.
      • setWidth

        public void setWidth​(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 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object