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>
ImmutableVideo
componentSupport @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 typeIVideo
.static class
IVideo.Crossorigin
Specifies the crossorigin setting withwithCrossorigin(Crossorigin)
static class
IVideo.Updater
Builds an updater of typeIVideo
forUiAgent.smartUpdate(Locator, SmartUpdater)
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Video
getContent()
Returns the content set bywithContent(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 isdefault 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 givenITrack
children.static IVideo
of(java.lang.String src)
Returns the instance with the givensrc
.static IVideo
of(ITrack... children)
Returns the instance with the givenITrack
children.static IVideo
ofId(java.lang.String id)
Returns the instance with the given id.IVideo
withAutoplay(boolean autoplay)
Returns a copy ofthis
immutable component with the specifiedautoplay
.IVideo
withClipToFit(boolean clipToFit)
Returns a copy ofthis
immutable component with the specifiedclipToFit
.IVideo
withContent(Video content)
Returns a copy ofthis
immutable component with the specifiedcontent
.IVideo
withControls(boolean controls)
Returns a copy ofthis
immutable component with the specifiedcontrols
.IVideo
withCrossorigin(java.lang.String crossorigin)
Returns a copy ofthis
immutable component with the specifiedcrossorigin
.default IVideo
withCrossorigin(IVideo.Crossorigin crossorigin)
Returns a copy ofthis
immutable component with the specifiedcrossorigin
.IVideo
withDimBackground(boolean dimBackground)
Returns a copy ofthis
immutable component with the specifieddimBackground
.IVideo
withLoop(boolean loop)
Returns a copy ofthis
immutable component with the specifiedloop
.IVideo
withMuted(boolean muted)
Returns a copy ofthis
immutable component with the specifiedvolume
.IVideo
withPlaybackRate(double playbackRate)
Returns a copy ofthis
immutable component with the specifiedplaybackRate
.IVideo
withPlaysinline(boolean playsinline)
Returns a copy ofthis
immutable component with the specifiedplaysinline
.IVideo
withPoster(java.lang.String poster)
Returns a copy ofthis
immutable component with the specifiedposter
.IVideo
withPreload(java.lang.String preload)
Returns a copy ofthis
immutable component with the specifiedpreload
.IVideo
withSrc(java.lang.Iterable<java.lang.String> src)
Returns a copy ofthis
immutable component with the specifiedplaceholder
.default IVideo
withSrc(java.lang.String src)
Returns a copy ofthis
immutable component with the specifiedplaceholder
.IVideo
withVolume(double volume)
Returns a copy ofthis
immutable component with the specifiedvolume
.-
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 interfaceIComponent<IVideo>
-
getPreload
@Nullable java.lang.String getPreload()
Returns whether and how the video should be loaded. "none", "metadata", "auto" or nullDefault:
null
.
-
withPreload
IVideo withPreload(@Nullable java.lang.String preload)
Returns a copy ofthis
immutable component with the specifiedpreload
.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 ofthis
immutable component with the specifiedposter
.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 ofthis
immutable component with the specifiedcrossorigin
.Sets the crossorigin of the video, could be
"anonymous"
,"use-credentials"
ornull
.- Parameters:
crossorigin
- The crossorigin of the video, could be"anonymous"
,"use-credentials"
ornull
.Default:
null
.- Returns:
- A modified copy of the
this
object
-
withCrossorigin
default IVideo withCrossorigin(@Nullable IVideo.Crossorigin crossorigin)
Returns a copy ofthis
immutable component with the specifiedcrossorigin
.Sets the crossorigin of the video, could be
"anonymous"
,"use-credentials"
ornull
.- Parameters:
crossorigin
- The crossorigin of the video, could be"anonymous"
,"use-credentials"
ornull
.Default:
null
.- Returns:
- A modified copy of the
this
object
-
getContent
@Nullable Video getContent()
Returns the content set bywithContent(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 towithContent(org.zkoss.video.Video)
.Default:
null
-
withContent
IVideo withContent(@Nullable Video content)
Returns a copy ofthis
immutable component with the specifiedcontent
.Sets the content of the video
Note: If calling this with
withSrc(java.lang.Iterable<java.lang.String>)
, thewithContent(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 ofthis
immutable component with the specifiedplaceholder
.Sets the src of the video. Note: If calling this with
withContent(org.zkoss.video.Video)
, thewithContent(org.zkoss.video.Video)
has higher priority- Parameters:
src
- The src of the componentDefault:
[]
.- Returns:
- A modified copy of the
this
object
-
withSrc
default IVideo withSrc(java.lang.String src)
Returns a copy ofthis
immutable component with the specifiedplaceholder
.Sets the src of the video. Note: If calling this with
withContent(org.zkoss.video.Video)
, thewithContent(org.zkoss.video.Video)
has higher priority- Parameters:
src
- The src of the componentDefault:
[]
.- 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 ofthis
immutable component with the specifiedautoplay
.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 ofthis
immutable component with the specifiedcontrols
.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 ofthis
immutable component with the specifiedloop
.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 ofthis
immutable component with the specifieddimBackground
.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 VideoDefault:
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 ofthis
immutable component with the specifiedplaysinline
.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
, it will cut off the sides of the video, preserving the aspect ratio, and also filling in the space.<video width="1000px" height="720px" />
Default:
false
.
-
withClipToFit
IVideo withClipToFit(boolean clipToFit)
Returns a copy ofthis
immutable component with the specifiedclipToFit
.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
, it will cut off the sides of the video, preserving the aspect ratio, and also filling in the space.<video width="1000px" height="720px" />
- 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 ofthis
immutable component with the specifiedplaybackRate
.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 ofthis
immutable component with the specifiedvolume
.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 ofthis
immutable component with the specifiedvolume
.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 givensrc
.- Parameters:
src
- The URI of the audio source.
-
of
static IVideo of(java.lang.Iterable<ITrack> children)
Returns the instance with the givenITrack
children.- Parameters:
children
- The children ofITrack
-
of
static IVideo of(ITrack... children)
Returns the instance with the givenITrack
children.- Parameters:
children
- The children ofITrack
-
ofId
static IVideo ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id
- The id to identify this component
-
-