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(). |
AbstractComponent.Children| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.String> |
_src |
static int |
END
Represent the end state
|
static int |
PAUSE
Represent the pause state
|
static int |
PLAY
Represent the play state
|
static int |
STOP
Represent the stop state
|
_zclassAPPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEAFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE| Modifier and Type | Method and Description |
|---|---|
void |
beforeChildAdded(Component child,
Component insertBefore)
Default: does nothing.
|
Audio |
getContent()
Returns the content set by
setContent(org.zkoss.sound.Audio). |
java.lang.Object |
getExtraCtrl()
Returns the client control for this component.
|
java.lang.String |
getPreload()
Returns whether and how the audio should be loaded.
|
java.util.List<java.lang.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 |
isEnded()
Return whether the audio is ended.
|
boolean |
isLoop()
Returns whether to play the audio repeatedly.
|
boolean |
isMuted()
Returns whether to mute the audio.
|
boolean |
isPaused()
Return whether the audio is paused.
|
boolean |
isPlaying()
Return whether the audio is playing.
|
boolean |
isStopped()
Return whether the audio is stopped.
|
void |
pause()
Pauses the audio at the client.
|
void |
play()
Plays the audio at the client.
|
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing
tags and children.
|
void |
service(AuRequest request,
boolean everError)
Processes an AU request.
|
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(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(java.lang.String preload)
Sets whether and how the audio should be loaded.
|
void |
setSrc(java.util.List<java.lang.String> src)
Sets the source list.
|
void |
setSrc(java.lang.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, setTooltipAttributesaddSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, 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, setZIndexDirectlyaddAnnotation, 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, willSerializeequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinvalidatePartialpublic static final int STOP
public static final int PLAY
public static final int PAUSE
public static final int END
protected java.util.List<java.lang.String> _src
public void service(AuRequest request, boolean everError)
HtmlBasedComponentDefault: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.
service in interface ComponentCtrlservice in class HtmlBasedComponenteverError - whether any error ever occurred before
processing this request.AbstractComponent.setAuService(org.zkoss.zk.au.AuService)public void play()
public void stop()
public void pause()
public java.util.List<java.lang.String> getSrc()
Default: [].
public void setSrc(java.lang.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 void setSrc(java.util.List<java.lang.String> src)
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 java.lang.String getPreload()
Default: null.
public void setPreload(java.lang.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 boolean isPlaying()
public boolean isPaused()
public boolean isStopped()
public boolean isEnded()
public void setContent(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 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(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponentrenderProperties in class XulElementjava.io.IOExceptionpublic void beforeChildAdded(Component child, Component insertBefore)
AbstractComponentbeforeChildAdded in interface ComponentCtrlbeforeChildAdded in class AbstractComponentchild - the child to be added (never null).insertBefore - another child component that the new child
will be inserted before it. If null, the new child will be the
last child.ComponentCtrl.beforeChildAdded(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)public java.lang.Object getExtraCtrl()
HtmlBasedComponentDefault: creates an instance of HtmlBasedComponent.ExtraCtrl.
getExtraCtrl in interface ComponentCtrlgetExtraCtrl in class HtmlBasedComponentCropper.ComponentCtrl.getExtraCtrl()Copyright © 2005-2024 Potix Corporation. All Rights Reserved.