Package org.zkoss.stateless.sul

## Interface IVideo

- All Superinterfaces:
    `IAnyGroup<IVideo>`, `IChildable<IVideo,​ITrack>`, `IComponent<IVideo>`, `IHtmlBasedComponent<IVideo>`, `IXulElement<IVideo>`

      public interface IVideo
      extends IXulElement<IVideo>, IAnyGroup<IVideo>, IChildable<IVideo,​ITrack>

  Immutable `Video` component

  ### Support @Action

  Name | Action Type
  --- | ---
  onStateChange | ActionData: `StateChangeData` Notifies when invoking play(), stop(), pause() or the video is played to the end.

  Author:
    katherine
  See Also:
    `Video`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IVideo.Builder` | Builds instances of type `IVideo`.
    `static class` | `IVideo.Crossorigin` | Specifies the crossorigin setting with `withCrossorigin(Crossorigin)`
    `static class` | `IVideo.Updater` | Builds an updater of type `IVideo` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IVideo` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Video` | `getContent()` | Returns the content set by `withContent(org.zkoss.video.Video)`.
    `java.lang.String` | `getCrossorigin()` | Returns the crossorigin of this video tag, could be "anonymous", "use-credentials" or null.
    `default double` | `getPlaybackRate()` | Returns the video play speed.
    `java.lang.String` | `getPoster()` | Returns the image source, if didn't set the image, return null.
    `java.lang.String` | `getPreload()` | Returns whether and how the video should be loaded.
    `default java.util.List<java.lang.String>` | `getSrc()` | Returns the src.
    `default double` | `getVolume()` | Returns the volume of video.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isAutoplay()` | Returns whether to auto start playing the video.
    `default boolean` | `isClipToFit()` | Return whether to clip video when the source size doesn't fit the tag size setting, for example: if video source is 1280 * 720, but the video tag is
    `default boolean` | `isControls()` | Returns whether to display the video controls.
    `default boolean` | `isDimBackground()` | Returns whether to turn whole page to be covered by translucent black except the Video, also called theater mode.
    `default boolean` | `isLoop()` | Returns whether to play the video repeatedly.
    `default boolean` | `isMuted()` | Returns whether the video is muted.
    `default boolean` | `isPlaysinline()` | Returns the playsinline of this video tag.
    `static IVideo` | `of​(java.lang.Iterable<ITrack> children)` | Returns the instance with the given `ITrack` children.
    `static IVideo` | `of​(java.lang.String src)` | Returns the instance with the given `src`.
    `static IVideo` | `of​(ITrack... children)` | Returns the instance with the given `ITrack` children.
    `static IVideo` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `IVideo` | `withAutoplay​(boolean autoplay)` | Returns a copy of `this` immutable component with the specified `autoplay`.
    `IVideo` | `withClipToFit​(boolean clipToFit)` | Returns a copy of `this` immutable component with the specified `clipToFit`.
    `IVideo` | `withContent​(Video content)` | Returns a copy of `this` immutable component with the specified `content`.
    `IVideo` | `withControls​(boolean controls)` | Returns a copy of `this` immutable component with the specified `controls`.
    `IVideo` | `withCrossorigin​(java.lang.String crossorigin)` | Returns a copy of `this` immutable component with the specified `crossorigin`.
    `default IVideo` | `withCrossorigin​(IVideo.Crossorigin crossorigin)` | Returns a copy of `this` immutable component with the specified `crossorigin`.
    `IVideo` | `withDimBackground​(boolean dimBackground)` | Returns a copy of `this` immutable component with the specified `dimBackground`.
    `IVideo` | `withLoop​(boolean loop)` | Returns a copy of `this` immutable component with the specified `loop`.
    `IVideo` | `withMuted​(boolean muted)` | Returns a copy of `this` immutable component with the specified `volume`.
    `IVideo` | `withPlaybackRate​(double playbackRate)` | Returns a copy of `this` immutable component with the specified `playbackRate`.
    `IVideo` | `withPlaysinline​(boolean playsinline)` | Returns a copy of `this` immutable component with the specified `playsinline`.
    `IVideo` | `withPoster​(java.lang.String poster)` | Returns a copy of `this` immutable component with the specified `poster`.
    `IVideo` | `withPreload​(java.lang.String preload)` | Returns a copy of `this` immutable component with the specified `preload`.
    `IVideo` | `withSrc​(java.lang.Iterable<java.lang.String> src)` | Returns a copy of `this` immutable component with the specified `placeholder`.
    `default IVideo` | `withSrc​(java.lang.String src)` | Returns a copy of `this` immutable component with the specified `placeholder`.
    `IVideo` | `withVolume​(double volume)` | Returns a copy of `this` immutable component with the specified `volume`.

    - ### Methods inherited from interface org.zkoss.stateless.sul.IChildable

      `getChildren, withChildren, withChildren`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IComponent

      `getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IXulElement

      `getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip`

- - ### Field Detail

    - #### DEFAULT

          static final IVideo DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zkmax.med.Video"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IVideo>`

    - #### getPreload

          @Nullable
          java.lang.String getPreload()

      Returns whether and how the video should be loaded. "none", "metadata", "auto" or null

      Default: `null`.

    - #### withPreload

          IVideo withPreload​(@Nullable
                             java.lang.String preload)

      Returns a copy of `this` immutable component with the specified `preload`.

      Sets whether and how the video should be loaded. Refer to Preload Attribute Description for details.

      Parameters:
        `preload` - Whether and how the video should be loaded. ("none", "metadata", "auto" or null)

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getPoster

          @Nullable
          java.lang.String getPoster()

      Returns the image source, if didn't set the image, return null.

      Default: `null`.

    - #### withPoster

          IVideo withPoster​(@Nullable
                            java.lang.String poster)

      Returns a copy of `this` immutable component with the specified `poster`.

      Sets an image to be shown while the video is downloading, or until the user hits the play button.

      Parameters:
        `poster` - An image to be shown while the video is downloading, or until the user hits the play button.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getCrossorigin

          @Nullable
          java.lang.String getCrossorigin()

      Returns the crossorigin of this video tag, could be "anonymous", "use-credentials" or null.

      Default: `null`.

    - #### withCrossorigin

          IVideo withCrossorigin​(@Nullable
                                 java.lang.String crossorigin)

      Returns a copy of `this` immutable component with the specified `crossorigin`.

      Sets the crossorigin of the video, could be `"anonymous"`, `"use-credentials"` or `null`.

      Parameters:
        `crossorigin` - The crossorigin of the video, could be `"anonymous"`, `"use-credentials"` or `null`.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### withCrossorigin

          default IVideo withCrossorigin​(@Nullable
                                         IVideo.Crossorigin crossorigin)

      Returns a copy of `this` immutable component with the specified `crossorigin`.

      Sets the crossorigin of the video, could be `"anonymous"`, `"use-credentials"` or `null`.

      Parameters:
        `crossorigin` - The crossorigin of the video, could be `"anonymous"`, `"use-credentials"` or `null`.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getContent

          @Nullable
          Video getContent()

      Returns the content set by `withContent(org.zkoss.video.Video)`.

      Note: it won't fetch what is set thru by `withSrc(java.lang.Iterable<java.lang.String>)`. It simply returns what is passed to `withContent(org.zkoss.video.Video)`.

      Default: `null`

    - #### withContent

          IVideo withContent​(@Nullable
                             Video content)

      Returns a copy of `this` immutable component with the specified `content`.

      Sets the content of the video

      Note: If calling this with `withSrc(java.lang.Iterable<java.lang.String>)`, the `withContent(org.zkoss.video.Video)` has higher priority

      Parameters:
        `content` - The content of the audio.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getSrc

          default java.util.List<java.lang.String> getSrc()

      Returns the src.

      Default: [].

    - #### withSrc

          IVideo withSrc​(java.lang.Iterable<java.lang.String> src)

      Returns a copy of `this` immutable component with the specified `placeholder`.

      Sets the src of the video. Note: If calling this with `withContent(org.zkoss.video.Video)`, the `withContent(org.zkoss.video.Video)` has higher priority

      Parameters:
        `src` - The src of the component

        Default: `[]`.

      Returns:
        A modified copy of the `this` object

    - #### withSrc

          default IVideo withSrc​(java.lang.String src)

      Returns a copy of `this` immutable component with the specified `placeholder`.

      Sets the src of the video. Note: If calling this with `withContent(org.zkoss.video.Video)`, the `withContent(org.zkoss.video.Video)` has higher priority

      Parameters:
        `src` - The src of the component

        Default: `[]`.

      Returns:
        A modified copy of the `this` object

    - #### isAutoplay

          default boolean isAutoplay()

      Returns whether to auto start playing the video.

      Default: `false`.

    - #### withAutoplay

          IVideo withAutoplay​(boolean autoplay)

      Returns a copy of `this` immutable component with the specified `autoplay`.

      Sets whether to auto start playing the video.

      Parameters:
        `autoplay` - Whether to auto start playing the video.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isControls

          default boolean isControls()

      Returns whether to display the video controls.

      Default: `false`.

    - #### withControls

          IVideo withControls​(boolean controls)

      Returns a copy of `this` immutable component with the specified `controls`.

      Sets whether to display the video controls.

      Parameters:
        `controls` - Whether to display the video controls.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isLoop

          default boolean isLoop()

      Returns whether to play the video repeatedly.

      Default: `false`.

    - #### withLoop

          IVideo withLoop​(boolean loop)

      Returns a copy of `this` immutable component with the specified `loop`.

      Sets whether to play the video repeatedly.

      Parameters:
        `loop` - Whether to play the video repeatedly.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isDimBackground

          default boolean isDimBackground()

      Returns whether to turn whole page to be covered by translucent black except the Video, also called theater mode. When theater mode is enabled, user can click anywhere on the page except the Video to disable theater mode.

      Default: `false`.

    - #### withDimBackground

          IVideo withDimBackground​(boolean dimBackground)

      Returns a copy of `this` immutable component with the specified `dimBackground`.

      Sets whether to turn whole page to be covered by translucent black except the Video, also called theater mode. When theater mode is enabled, user can click anywhere on the page except the Video to disable theater mode.

      Parameters:
        `dimBackground` - whether to turn whole page to be covered by translucent black except the Video

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isPlaysinline

          default boolean isPlaysinline()

      Returns the playsinline of this video tag.

      Default: `false`.

    - #### withPlaysinline

          IVideo withPlaysinline​(boolean playsinline)

      Returns a copy of `this` immutable component with the specified `playsinline`.

      Sets the playsinline of this video tag. Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.

      Parameters:
        `playsinline` - The playsinline of this video tag.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isClipToFit

          default boolean isClipToFit()

      Return whether to clip video when the source size doesn't fit the tag size setting, for example: if video source is 1280 * 720, but the video tag is

          <video width="1000px" height="720px" />

      , it will cut off the sides of the video, preserving the aspect ratio, and also filling in the space.

      Default: `false`.

    - #### withClipToFit

          IVideo withClipToFit​(boolean clipToFit)

      Returns a copy of `this` immutable component with the specified `clipToFit`.

      Sets whether to clip video when the source size doesn't fit the tag size setting, for example: if video source is 1280 * 720, but the video tag is

          <video width="1000px" height="720px" />

      , it will cut off the sides of the video, preserving the aspect ratio, and also filling in the space.
      Parameters:
        `clipToFit` - Whether to clip video when the source size doesn't fit the tag size setting.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### getPlaybackRate

          default double getPlaybackRate()

      Returns the video play speed.

      Default: `1.0`.

    - #### withPlaybackRate

          IVideo withPlaybackRate​(double playbackRate)

      Returns a copy of `this` immutable component with the specified `playbackRate`.

      Sets the video play speed, type of value is in double, valid value is depending on browser.

      Parameters:
        `playbackRate` - The video play speed.

        Default: `1.0`.

      Returns:
        A modified copy of the `this` object

    - #### getVolume

          default double getVolume()

      Returns the volume of video. Default: `1.0`

    - #### withVolume

          IVideo withVolume​(double volume)

      Returns a copy of `this` immutable component with the specified `volume`.

      Sets the volume of video.

      Parameters:
        `volume` - the volume of video.

        Default: `1.0`.

      Returns:
        A modified copy of the `this` object

    - #### isMuted

          default boolean isMuted()

      Returns whether the video is muted.

      Default: depends on `getVolume()`

    - #### withMuted

          IVideo withMuted​(boolean muted)

      Returns a copy of `this` immutable component with the specified `volume`.

      Sets whether to mute the video.

      Parameters:
        `muted` - Whether to mute the video.

        Default: depends on `getVolume()`

      Returns:
        A modified copy of the `this` object

    - #### of

          static IVideo of​(java.lang.String src)

      Returns the instance with the given `src`.
      Parameters:
        `src` - The URI of the audio source.

    - #### of

          static IVideo of​(java.lang.Iterable<ITrack> children)

      Returns the instance with the given `ITrack` children.
      Parameters:
        `children` - The children of `ITrack`

    - #### of

          static IVideo of​(ITrack... children)

      Returns the instance with the given `ITrack` children.
      Parameters:
        `children` - The children of `ITrack`

    - #### ofId

          static IVideo ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component