Image:stop.png This documentation is for an older version of ZK. For the latest documentationplease click here .

Audio

An audio component is used to play the audio at the browser. Like image , you could use the src property to specify an URL of an audio resource, or the setContent method to specify a dynamically generated audio.

Depending on the browser and the audio plugin, developers might be able to control the play of an audio by the play , stop and pause methods. Currently, Internet Explorer with Media Player is capable of such controls.

    <audio id="audio" height="20"/>
   

Class Name

org.zkoss.zul.Audio

Supported Child Components

*NONE

Supported Events

*NONE

Properties

Property

Description

Data Type

Default Value

align

Sets the alignment: one of top ,

Value: texttop, middle, absmiddle, bottom, absbottom, baseline, left, right and center.

java.lang.String

<null>

aut ostart

Sets whether to auto start playing the audio .

boolean

false

border

Sets the width of the border.

java.lang.Str ing

<null>

con tent

Sets the content directly.

org.zkoss.sound.Audio

<null>

src

Sets the src.

java.lang.Str ing

<null>

Methods

Name

Description

Return Data Type

isChildable()

Determines whether it accepts child components

Value: false

Note: No child is allowed.

boolean

pause()

Pauses the audio at the client.

void

play()

Plays the audio at the client.

void

stop()

Stops the audio at the client.

void

Inherited From