OverviewSince 4.0 The mobi:micrBophone component renders a button that leverages HTML5 "getUserMedia" techniques to record audio and upload it to the server, storing the sound clip as the value of this component. If no microphone is available, or the user denies access to use it, a file upload control will be rendered by the component that can be used to select an audio file to upload instead of recording one.
Getting StartedTo start using the Microphone component, simply place the mobi:microphone tag inside a form and bind the value to a backing bean property. <h:form> <mobi:microphone id="microphone" value="#{bean.clip}" buttonLabel="Microphone" captureMessageLabel="Sound clip captured"/> </h:form> private Map clip = new HashMap(); public void setClip(Map clip) { this.clip = clip; } public Map getClip() { return clip; } Supported PlatformsThis component relies on the HTML5 "getUserMedia" feature support in the client browser to provide access to the device's native microphone device(s). Support for accessing the native microphone(s) varies depending on the underlaying platform and browser version. The table below provides an overview of the platform/browser support as of the ICEfaces 4.2 release.
Attributes
The value attribute must resolve to an object of type java.util.Map<String,Object> in the backing bean. Once the sound clip is uploaded, this map will contain the following keys: 'file' will be mapped to the File object representing the sound clip, 'contentType' will be mapped to a string that indicates the content type of the file, and 'relativePath' will be mapped to a string containing the relative path of the file in the server. The buttonLabel specifies the label of the button before it is activated. The captureMessageLabel specifies the label to be displayed on the button on a successful sound clip capture. Event ListenersNone. Client Behavior EventsNone. JavaScript APINone. Keyboard SupportStandard keyboard actions for HTML buttons are supported, such as tabindex and pressing the enter or space keys to activate the button. Known IssuesThis component is not supported on iOS devices due to lack of support of the getUserMedia API and of other HTML5 features. Additional ResourcesSample ApplicationsThis component appears in the following ICEfaces sample applications: TutorialsThis component appears in the following ICEfaces tutorials: None |
Microphone
© Copyright 2021 ICEsoft Technologies Canada Corp.