Class VideoBox


public class VideoBox extends Component<VideoBox>

Video box component

The component displays videos that are on either an internal or external URL. The displayed video's format must be supported by the browser, otherwise the user won't be able to play the video.

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • VideoBox

      public VideoBox(String url)
      Creates a video box component, with the specified video
      Parameters:
      url - The URL address of the video source.
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • VideoBox

      public VideoBox(String id, String url)
      Creates a video box component, with the specified video
      Parameters:
      id - The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
      url - The URL address of the video source.
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • VideoBox

      public VideoBox(String url, String width, String height)
      Creates a video box component, with the specified video and component size
      Parameters:
      url - The URL address of the video source.
      width - The width of the component, specified by using CSS3 units. Can be specified in pixel or percentage.
      height - The height of the component, specified by using CSS3 units. Can be specified in pixel or percentage.
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • VideoBox

      public VideoBox(String id, String url, String width, String height)
      Creates a video box component, with the specified video and component size
      Parameters:
      id - The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
      url - The URL address of the video source.
      width - The width of the component, specified by using CSS3 units. Can be specified in pixel or percentage.
      height - The height of the component, specified by using CSS3 units. Can be specified in pixel or percentage.
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
  • Method Details

    • getWidth

      public String getWidth()
      Gets the video box's width
      Returns:
      The component's width or null, if the width wasn't set
    • setWidth

      public void setWidth(String width)
      Sets the video box's width
      Parameters:
      width - The width of the component, specified by using CSS3 units. Can be specified in pixel or percentage.
    • getHeight

      public String getHeight()
      Gets the video box's height
      Returns:
      The component's height or null, if the height wasn't set
    • setHeight

      public void setHeight(String height)
      Sets the video box's height
      Parameters:
      height - The height of the component, specified by using CSS3 units. Can be specified in pixel or percentage.
    • getURL

      public String getURL()
      Gets the video URL
      Returns:
      The video URL
    • setURL

      public void setURL(String url)
      Sets the video URL. The video content will be loaded from the specified URL
      Parameters:
      url - The full URL, that contains the video
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<VideoBox>
      Returns:
      If the componentwas drawn, true, otherwise false