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>
ImmutableVideocomponentSupport @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 classIVideo.BuilderBuilds instances of typeIVideo.static classIVideo.CrossoriginSpecifies the crossorigin setting withwithCrossorigin(Crossorigin)static classIVideo.UpdaterBuilds an updater of typeIVideoforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description org.zkoss.video.VideogetContent()Returns the content set bywithContent(org.zkoss.video.Video).java.lang.StringgetCrossorigin()Returns the crossorigin of this video tag, could be "anonymous", "use-credentials" or null.default doublegetPlaybackRate()Returns the video play speed.java.lang.StringgetPoster()Returns the image source, if didn't set the image, return null.java.lang.StringgetPreload()Returns whether and how the video should be loaded.default java.util.List<java.lang.String>getSrc()Returns the src.default doublegetVolume()Returns the volume of video.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisAutoplay()Returns whether to auto start playing the video.default booleanisClipToFit()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 booleanisControls()Returns whether to display the video controls.default booleanisDimBackground()Returns 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 booleanisPlaysinline()Returns the playsinline of this video tag.static IVideoof(java.lang.Iterable<ITrack> children)Returns the instance with the givenITrackchildren.static IVideoof(java.lang.String src)Returns the instance with the givensrc.static IVideoof(ITrack... children)Returns the instance with the givenITrackchildren.static IVideoofId(java.lang.String id)Returns the instance with the given id.IVideowithAutoplay(boolean autoplay)Returns a copy ofthisimmutable component with the specifiedautoplay.IVideowithClipToFit(boolean clipToFit)Returns a copy ofthisimmutable component with the specifiedclipToFit.IVideowithContent(org.zkoss.video.Video content)Returns a copy ofthisimmutable component with the specifiedcontent.IVideowithControls(boolean controls)Returns a copy ofthisimmutable component with the specifiedcontrols.IVideowithCrossorigin(java.lang.String crossorigin)Returns a copy ofthisimmutable component with the specifiedcrossorigin.default IVideowithCrossorigin(IVideo.Crossorigin crossorigin)Returns a copy ofthisimmutable component with the specifiedcrossorigin.IVideowithDimBackground(boolean dimBackground)Returns a copy ofthisimmutable component with the specifieddimBackground.IVideowithLoop(boolean loop)Returns a copy ofthisimmutable component with the specifiedloop.IVideowithMuted(boolean muted)Returns a copy ofthisimmutable component with the specifiedvolume.IVideowithPlaybackRate(double playbackRate)Returns a copy ofthisimmutable component with the specifiedplaybackRate.IVideowithPlaysinline(boolean playsinline)Returns a copy ofthisimmutable component with the specifiedplaysinline.IVideowithPoster(java.lang.String poster)Returns a copy ofthisimmutable component with the specifiedposter.IVideowithPreload(java.lang.String preload)Returns a copy ofthisimmutable component with the specifiedpreload.IVideowithSrc(java.lang.Iterable<java.lang.String> src)Returns a copy ofthisimmutable component with the specifiedplaceholder.default IVideowithSrc(java.lang.String src)Returns a copy ofthisimmutable component with the specifiedplaceholder.IVideowithVolume(double volume)Returns a copy ofthisimmutable 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:
getWidgetClassin 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 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
@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 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
@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 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
default IVideo withCrossorigin(@Nullable IVideo.Crossorigin crossorigin)
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
IVideo withContent(@Nullable org.zkoss.video.Video content)
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
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 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
default IVideo withSrc(java.lang.String src)
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
IVideo withAutoplay(boolean autoplay)
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
IVideo withControls(boolean controls)
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
IVideo withLoop(boolean loop)
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
IVideo withDimBackground(boolean dimBackground)
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
IVideo withPlaysinline(boolean playsinline)
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
IVideo withClipToFit(boolean clipToFit)
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
IVideo withPlaybackRate(double playbackRate)
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
IVideo withVolume(double volume)
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
IVideo withMuted(boolean muted)
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
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 givenITrackchildren.- Parameters:
children- The children ofITrack
-
of
static IVideo of(ITrack... children)
Returns the instance with the givenITrackchildren.- 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
-
-