Interface IVideo
- All Superinterfaces:
IAnyGroup<IVideo>,IChildable<IVideo,,ITrack> IComponent<IVideo>,IHtmlBasedComponent<IVideo>,IXulElement<IVideo>
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 ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIVideo.static enumSpecifies the crossorigin setting withwithCrossorigin(Crossorigin)static classBuilds an updater of typeIVideoforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionorg.zkoss.video.VideoReturns the content set bywithContent(org.zkoss.video.Video).Returns the crossorigin of this video tag, could be "anonymous", "use-credentials" or null.default doubleReturns the video play speed.Returns the image source, if didn't set the image, return null.Returns whether and how the video should be loaded.getSrc()Returns the src.default doubleReturns the volume of video.default StringReturns the client widget class.default booleanReturns whether to auto start playing the video.default booleanReturn 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 booleanReturns whether to display the video controls.default booleanReturns whether to turn whole page to be covered by translucent black except the Video, also called theater mode.default booleanisLoop()Returns whether to play the video repeatedly.default booleanisMuted()Returns whether the video is muted.default booleanReturns the playsinline of this video tag.static IVideoReturns the instance with the givenITrackchildren.static IVideoReturns the instance with the givensrc.static IVideoReturns the instance with the givenITrackchildren.static IVideoReturns the instance with the given id.withAutoplay(boolean autoplay) Returns a copy ofthisimmutable component with the specifiedautoplay.withClipToFit(boolean clipToFit) Returns a copy ofthisimmutable component with the specifiedclipToFit.withContent(org.zkoss.video.Video content) Returns a copy ofthisimmutable component with the specifiedcontent.withControls(boolean controls) Returns a copy ofthisimmutable component with the specifiedcontrols.withCrossorigin(String crossorigin) Returns a copy ofthisimmutable component with the specifiedcrossorigin.default IVideowithCrossorigin(IVideo.Crossorigin crossorigin) Returns a copy ofthisimmutable component with the specifiedcrossorigin.withDimBackground(boolean dimBackground) Returns a copy ofthisimmutable component with the specifieddimBackground.withLoop(boolean loop) Returns a copy ofthisimmutable component with the specifiedloop.withMuted(boolean muted) Returns a copy ofthisimmutable component with the specifiedvolume.withPlaybackRate(double playbackRate) Returns a copy ofthisimmutable component with the specifiedplaybackRate.withPlaysinline(boolean playsinline) Returns a copy ofthisimmutable component with the specifiedplaysinline.withPoster(String poster) Returns a copy ofthisimmutable component with the specifiedposter.withPreload(String preload) Returns a copy ofthisimmutable component with the specifiedpreload.Returns a copy ofthisimmutable component with the specifiedplaceholder.default IVideoReturns a copy ofthisimmutable component with the specifiedplaceholder.withVolume(double volume) Returns a copy ofthisimmutable component with the specifiedvolume.Methods inherited from interface org.zkoss.stateless.sul.IChildable
getChildren, withChildren, withChildrenMethods 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, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndexMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zkmax.med.Video"- Specified by:
getWidgetClassin interfaceIComponent<IVideo>
-
getPreload
Returns whether and how the video should be loaded. "none", "metadata", "auto" or nullDefault:
null. -
withPreload
Returns a copy ofthisimmutable 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
thisobject
-
getPoster
Returns the image source, if didn't set the image, return null.Default:
null. -
withPoster
Returns a copy ofthisimmutable 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
thisobject
-
getCrossorigin
Returns the crossorigin of this video tag, could be "anonymous", "use-credentials" or null.Default:
null. -
withCrossorigin
Returns a copy ofthisimmutable 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
thisobject
-
withCrossorigin
Returns a copy ofthisimmutable 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
thisobject
-
getContent
@Nullable org.zkoss.video.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
Returns a copy ofthisimmutable 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
thisobject
-
getSrc
Returns the src.Default: [].
-
withSrc
Returns a copy ofthisimmutable 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
thisobject
-
withSrc
Returns a copy ofthisimmutable 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
thisobject
-
isAutoplay
default boolean isAutoplay()Returns whether to auto start playing the video.Default:
false. -
withAutoplay
Returns a copy ofthisimmutable 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
thisobject
-
isControls
default boolean isControls()Returns whether to display the video controls.Default:
false. -
withControls
Returns a copy ofthisimmutable 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
thisobject
-
isLoop
default boolean isLoop()Returns whether to play the video repeatedly.Default:
false. -
withLoop
Returns a copy ofthisimmutable 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
thisobject
-
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
Returns a copy ofthisimmutable 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
thisobject
-
isPlaysinline
default boolean isPlaysinline()Returns the playsinline of this video tag.Default:
false. -
withPlaysinline
Returns a copy ofthisimmutable 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
thisobject
-
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
Returns a copy ofthisimmutable 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
thisobject
-
getPlaybackRate
default double getPlaybackRate()Returns the video play speed.Default:
1.0. -
withPlaybackRate
Returns a copy ofthisimmutable 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
thisobject
-
getVolume
default double getVolume()Returns the volume of video. Default:1.0 -
withVolume
Returns a copy ofthisimmutable component with the specifiedvolume.Sets the volume of video.
- Parameters:
volume- the volume of video.Default:
1.0.- Returns:
- A modified copy of the
thisobject
-
isMuted
default boolean isMuted()Returns whether the video is muted.Default: depends on
getVolume() -
withMuted
Returns a copy ofthisimmutable 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
thisobject
-
of
Returns the instance with the givensrc.- Parameters:
src- The URI of the audio source.
-
of
Returns the instance with the givenITrackchildren.- Parameters:
children- The children ofITrack
-
of
Returns the instance with the givenITrackchildren.- Parameters:
children- The children ofITrack
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-