public class Audio extends XulElement implements MediaElement
An extension to XUL. Only works for browsers supporting HTML5 audio tag (since ZK 7.0.0).
Modifier and Type | Class and Description |
---|---|
protected class |
Audio.ExtraCtrl
A utility class to implement
HtmlBasedComponent.getExtraCtrl() . |
Modifier and Type | Field and Description |
---|---|
protected List<String> |
_src |
Modifier and Type | Method and Description |
---|---|
void |
beforeChildAdded(org.zkoss.zk.ui.Component child,
org.zkoss.zk.ui.Component insertBefore) |
org.zkoss.sound.Audio |
getContent()
Returns the content set by
setContent(org.zkoss.sound.Audio) . |
Object |
getExtraCtrl() |
String |
getPreload()
Returns whether and how the audio should be loaded.
|
List<String> |
getSrc()
Returns the src.
|
boolean |
isAutoplay()
Returns whether to auto start playing the audio.
|
boolean |
isAutostart()
Deprecated.
As of release 7.0.0, use
isAutoplay() instead. |
boolean |
isControls()
Returns whether to display the audio controls.
|
boolean |
isLoop()
Returns whether to play the audio repeatedly.
|
boolean |
isMuted()
Returns whether to mute the audio.
|
void |
pause()
Pauses the audio at the client.
|
void |
play()
Plays the audio at the client.
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
setAutoplay(boolean autoplay)
Sets whether to auto start playing the audio.
|
void |
setAutostart(boolean autostart)
Deprecated.
As of release 7.0.0, use
setAutoplay(boolean) instead. |
void |
setContent(org.zkoss.sound.Audio audio)
Sets the content directly.
|
void |
setControls(boolean controls)
Sets whether to display the audio controls.
|
void |
setLoop(boolean loop)
Sets whether to play the audio repeatedly.
|
void |
setMuted(boolean muted)
Sets whether to mute the audio.
|
void |
setPreload(String preload)
Sets whether and how the audio should be loaded.
|
void |
setSrc(List<String> src)
Sets the source list.
|
void |
setSrc(String src)
Sets the src.
|
void |
stop()
Stops the audio at the client.
|
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
addSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, invalidatePartial, isChildable, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
public Audio()
public Audio(String src)
public void play()
public void stop()
public void pause()
public void setSrc(String src)
Calling this method implies setContent(null).
In other words, the last invocation of setSrc(java.lang.String)
overrides
the previous setContent(org.zkoss.sound.Audio)
, if any.
setContent(org.zkoss.sound.Audio)
public boolean isAutostart()
isAutoplay()
instead.Default: false;
public void setAutostart(boolean autostart)
setAutoplay(boolean)
instead.public boolean isAutoplay()
Default: false.
public void setAutoplay(boolean autoplay)
public String getPreload()
Default: null.
public void setPreload(String preload)
preload
- which could be one of "none", "metadata", "auto".public boolean isControls()
Default: false.
public void setControls(boolean controls)
public boolean isLoop()
Default: false.
public void setLoop(boolean loop)
public boolean isMuted()
Default: false.
public void setMuted(boolean muted)
public void setContent(org.zkoss.sound.Audio audio)
Default: null.
Calling this method implies setSrc(null).
In other words, the last invocation of setContent(org.zkoss.sound.Audio)
overrides
the previous setSrc(java.lang.String)
, if any.
audio
- the audio to display.setSrc(java.lang.String)
public org.zkoss.sound.Audio getContent()
setContent(org.zkoss.sound.Audio)
.
Note: it won't fetch what is set thru by setSrc(java.lang.String)
.
It simply returns what is passed to setContent(org.zkoss.sound.Audio)
.
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException
renderProperties
in class XulElement
IOException
public void beforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component insertBefore)
beforeChildAdded
in interface org.zkoss.zk.ui.sys.ComponentCtrl
beforeChildAdded
in class org.zkoss.zk.ui.AbstractComponent
public Object getExtraCtrl()
getExtraCtrl
in interface org.zkoss.zk.ui.sys.ComponentCtrl
getExtraCtrl
in class org.zkoss.zk.ui.HtmlBasedComponent
Copyright © 2021. All rights reserved.