AudioPlayer

Table of Contents

Overview

Since 4.0

The ace:audioPlayer component renders an HTML5 <audio> element.

See the ICEfaces Showcase Live Demo of this component, complete with source code.

Getting Started

To start using the AudioPlayer component it is enough to specify an audio resource in the value attribute and the MIME type of such resource in the 'type' attribute.

<ace:audioPlayer id="audioPlayer"
		value="#{bean.resourcePath}"
		type="audio/mpeg" />

Attributes

TagLib Documentation
This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available here.

The value attribute specifies an audio resource, which can either be a string representing a relative path to the audio file in the server, or a byte array that contains the encoded media, or a JSF resource.

The controls flag will render the playback controls if set to true.

The loop flag will cause the player to keep playing the media repeatedly.

The autoplay flag will cause the media to be played at the moment the component is loaded on the page.

If muted is set to true, the audio will be muted. Note that in many OS's, this attribute is not dynamic, meaning that it's not possible to change it programmatically. Once it is set to a certain value in the markup, it cannot be changed again at the markup level. However, the user will still be able to change it using the native player controls (if provided).

The type attribute is used to specify the MIME type of the media file.

Event Listeners

None.

Client Behavior Events

None.

JavaScript API

Not applicable.

Keyboard Support

None.

CSS Classes

The following markup represents the basic HTML structure of the component and the CSS classes it uses.

<span class="mobi-audio [user defined classes]" style="[user defined styles]">
	<audio></audio>
	<a></a>
</span>

Known Issues

  • The ace:audioPlayer requires HTML5-compliant browser support and IS NOT supported on IE8 or IE9 browsers.

Other Notes

Regarding MIME types, it is known that certain application servers have certain default MIME types that are not supported by some browsers. It is advised to use the most standard MIME types so the videos can be played in all browsers. These are: audio/aac,
audio/mp4, audio/mpeg, audio/ogg, and audio/wav.

Additional Resources

Tutorials

This component appears in the following ICEfaces tutorials:

None

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2021 ICEsoft Technologies Canada Corp.