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
  • Field Details

    • DEFAULT

      static final IVideo DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zkmax.med.Video"

      Specified by:
      getWidgetClass in interface IComponent<IVideo>
    • getPreload

      @Nullable String getPreload()
      Returns whether and how the video should be loaded. "none", "metadata", "auto" or null

      Default: null.

    • withPreload

      IVideo withPreload(@Nullable 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 String getPoster()
      Returns the image source, if didn't set the image, return null.

      Default: null.

    • withPoster

      IVideo withPoster(@Nullable 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 String getCrossorigin()
      Returns the crossorigin of this video tag, could be "anonymous", "use-credentials" or null.

      Default: null.

    • withCrossorigin

      IVideo withCrossorigin(@Nullable 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 org.zkoss.video.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 org.zkoss.video.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 List<String> getSrc()
      Returns the src.

      Default: [].

    • withSrc

      IVideo withSrc(Iterable<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(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(String src)
      Returns the instance with the given src.
      Parameters:
      src - The URI of the audio source.
    • of

      static IVideo of(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(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component