Interface IAudio
- All Superinterfaces:
IAnyGroup<IAudio>,IChildable<IAudio,,ITrack> IComponent<IAudio>,IHtmlBasedComponent<IAudio>,IXulElement<IAudio>
Audio component
An audio clip.
Support @Action
| Name | Action Type |
|---|---|
| onStateChange | ActionData: StateChangeData
Notifies when invoking play(), stop(), pause() or the audio is played to the end. |
- Author:
- katherine
- See Also:
-
Audio
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIAudio.static classBuilds an updater of typeIAudioforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionorg.zkoss.sound.AudioReturns the content set bywithContent(org.zkoss.sound.Audio).Returns whether and how the audio should be loaded.getSrc()Returns the src.default StringReturns the client widget class.default booleanReturns whether to auto start playing the audio.default booleanReturns whether to display the audio controls.default booleanisLoop()Returns whether to play the audio repeatedly.default booleanisMuted()Returns whether to mute the audio.static IAudioReturns the instance with the givenITrackchildren.static IAudioReturns the instance with the givensrc.static IAudioReturns the instance with the givenITrackchildren.static IAudioReturns the instance with the given id.withAutoplay(boolean autoplay) Returns a copy ofthisimmutable component with the specifiedautoplay.withContent(org.zkoss.sound.Audio audio) Returns a copy ofthisimmutable component with the specifiedaudio.withControls(boolean controls) Returns a copy ofthisimmutable component with the specifiedcontrols.withLoop(boolean loop) Returns a copy ofthisimmutable component with the specifiedloop.withMuted(boolean muted) Returns a copy ofthisimmutable component with the specifiedmuted.withPreload(String preload) Returns a copy ofthisimmutable component with the specifiedpreload.Returns a copy ofthisimmutable component with the specifiedplaceholder.default IAudioReturns a copy ofthisimmutable component with the specifiedplaceholder.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:
"zul.med.Audio"- Specified by:
getWidgetClassin interfaceIComponent<IAudio>
-
getSrc
Returns the src.Default: [].
-
withSrc
Returns a copy ofthisimmutable component with the specifiedplaceholder.Sets the src of the audio. Note: If calling this with
withContent(org.zkoss.sound.Audio), thewithContent(org.zkoss.sound.Audio)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 audio.
Note: If calling this with
withContent(org.zkoss.sound.Audio), thewithContent(org.zkoss.sound.Audio)has higher priority- Parameters:
src- The src of the componentDefault:
[].- Returns:
- A modified copy of the
thisobject
-
getPreload
Returns whether and how the audio should be loaded. "none", "metadata", "auto" or nullDefault:
null. -
withPreload
Returns a copy ofthisimmutable component with the specifiedpreload.Sets whether and how the audio should be loaded. Refer to Preload Attribute Description for details.
- Parameters:
preload- Whether and how the audio should be loaded. ("none", "metadata", "auto" or null)Default:
null.- Returns:
- A modified copy of the
thisobject
-
getContent
@Nullable org.zkoss.sound.Audio getContent()Returns the content set bywithContent(org.zkoss.sound.Audio).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.sound.Audio).Default:
null -
withContent
Returns a copy ofthisimmutable component with the specifiedaudio.Sets the content of the audio
Note: If calling this with
withSrc(java.lang.Iterable<java.lang.String>), thewithContent(org.zkoss.sound.Audio)has higher priority- Parameters:
audio- The content of the audio.Default:
null.- Returns:
- A modified copy of the
thisobject
-
isAutoplay
default boolean isAutoplay()Returns whether to auto start playing the audio.Default:
false. -
withAutoplay
Returns a copy ofthisimmutable component with the specifiedautoplay.Sets whether to auto start playing the audio.
- Parameters:
autoplay- Whether to auto start playing the audio.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isControls
default boolean isControls()Returns whether to display the audio controls.Default:
false. -
withControls
Returns a copy ofthisimmutable component with the specifiedcontrols.Sets whether to display the audio controls.
- Parameters:
controls- Whether to display the audio controls.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isLoop
default boolean isLoop()Returns whether to play the audio repeatedly.Default:
false. -
withLoop
Returns a copy ofthisimmutable component with the specifiedloop.Sets whether to play the audio repeatedly.
- Parameters:
loop- Whether to play the audio repeatedly.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isMuted
default boolean isMuted()Returns whether to mute the audio.Default:
false. -
withMuted
Returns a copy ofthisimmutable component with the specifiedmuted.Sets whether to mute the audio.
- Parameters:
muted- Whether to mute the audio.Default:
false.- 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
-