Class Source

All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class Source extends WebMarkupContainer
The source of an audio or a video media component
Since:
7.0.0
Author:
Tobias Soloschenko, Andrew Lombardi
See Also:
  • Constructor Details

    • Source

      public Source(String id)
      Creates a source
      Parameters:
      id - the component id
    • Source

      public Source(String id, IModel<?> model)
      Creates a source
      Parameters:
      id - the component id
      model - the internally used model
    • Source

      public Source(String id, ResourceReference resourceReference)
      Creates a source
      Parameters:
      id - the component id
      resourceReference - the resource reference to provide the source data
    • Source

      public Source(String id, IModel<?> model, ResourceReference resourceReference)
      Creates a source
      Parameters:
      id - the component id
      model - the internally used model
      resourceReference - the resource reference to provide the source data
    • Source

      public Source(String id, ResourceReference resourceReference, PageParameters pageParameters)
      Creates a source
      Parameters:
      id - the component id
      pageParameters - the the page parameters applied to the source URL
      resourceReference - the resource reference to provide the source data
    • Source

      public Source(String id, IModel<?> model, ResourceReference resourceReference, PageParameters pageParameters)
      Creates a source
      Parameters:
      id - the component id
      model - the internally used model
      resourceReference - the resource reference to provide the source data
      pageParameters - the the page parameters applied to the source URL
    • Source

      public Source(String id, String url)
      Creates a source
      Parameters:
      id - the component id
      url - an external URL to provide the source information
    • Source

      public Source(String id, IModel<?> model, String url)
      Creates a source
      Parameters:
      id - the component id
      model - the internally used model
      url - an external URL to provide the source information
  • Method Details

    • onComponentTag

      protected void onComponentTag(ComponentTag tag)
      Description copied from class: Component
      Processes the component tag. Overrides of this method most likely should call the super implementation.
      Overrides:
      onComponentTag in class Component
      Parameters:
      tag - Tag to modify
    • getDisplayType

      public boolean getDisplayType()
      If the type is going to be displayed
      Returns:
      If the type is going to be displayed
    • setDisplayType

      public void setDisplayType(boolean displayType)
      Sets if the type is going to be displayed
      Parameters:
      displayType - if the type is going to be displayed
    • getType

      public String getType()
      Gets the type
      Returns:
      the type of this media element
      See Also:
    • setType

      public void setType(String type)
      Sets the type

      * The following list shows some examples of how to use the codecs= MIME parameter in the type attribute.

      H.264 Constrained baseline profile video (main and extended video compatible) level 3 and Low-Complexity AAC audio in MP4 container
      <source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
      H.264 Extended profile video (baseline-compatible) level 3 and Low-Complexity AAC audio in MP4 container
      <source src='video.mp4' type='video/mp4; codecs="avc1.58A01E, mp4a.40.2"'>
      H.264 Main profile video level 3 and Low-Complexity AAC audio in MP4 container
      <source src='video.mp4' type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"'>
      H.264 'High' profile video (incompatible with main, baseline, or extended profiles) level 3 and Low-Complexity AAC audio in MP4 container
      <source src='video.mp4' type='video/mp4; codecs="avc1.64001E, mp4a.40.2"'>
      MPEG-4 Visual Simple Profile Level 0 video and Low-Complexity AAC audio in MP4 container
      <source src='video.mp4' type='video/mp4; codecs="mp4v.20.8, mp4a.40.2"'>
      MPEG-4 Advanced Simple Profile Level 0 video and Low-Complexity AAC audio in MP4 container
      <source src='video.mp4' type='video/mp4; codecs="mp4v.20.240, mp4a.40.2"'>
      MPEG-4 Visual Simple Profile Level 0 video and AMR audio in 3GPP container
      <source src='video.3gp' type='video/3gpp; codecs="mp4v.20.8, samr"'>
      Theora video and Vorbis audio in Ogg container
      <source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'>
      Theora video and Speex audio in Ogg container
      <source src='video.ogv' type='video/ogg; codecs="theora, speex"'>
      Vorbis audio alone in Ogg container
      <source src='audio.ogg' type='audio/ogg; codecs=vorbis'>
      Speex audio alone in Ogg container
      <source src='audio.spx' type='audio/ogg; codecs=speex'>
      FLAC audio alone in Ogg container
      <source src='audio.oga' type='audio/ogg; codecs=flac'>
      Dirac video and Vorbis audio in Ogg container
      <source src='video.ogv' type='video/ogg; codecs="dirac, vorbis"'>
      Theora video and Vorbis audio in Matroska container
      <source src='video.mkv' type='video/x-matroska; codecs="theora, vorbis"'>
      Parameters:
      type - the type of this media element
    • getMedia

      public String getMedia()
      The media for which the content of this source should be shown
      Returns:
      The media for which the content of this source should be shown
      See Also:
    • setMedia

      public void setMedia(String media)
      Sets the media for which the content of this source should be shown

      <source src="movie.ogg" type="video/ogg" media="screen and (min-width:320px)">
      Parameters:
      media - the media for which to content of this source should be shown
    • getPageParameters

      Gets the page parameter applied to the URL of the source
      Returns:
      the page parameter applied to the URL of the source
    • setPageParameters

      public void setPageParameters(PageParameters pageParameters)
      Sets the page parameter applied to the URL of the source
      Parameters:
      pageParameters - the page parameter which are going to be applied to the URL of the source