Play audio and control start/stop by JSF app - jsf

I'm seeking for a solution how could I control playing the audio file from the JSF app.
I don't need the complete solution, just a reference to a component I could use to control playing the audio file (start/stop/change the sound).
I've tried to search in the past questions, but without a success.
My setup is based on Java EE 5, a migration to Java EE 6 might be the option too if really necessary.

If you use J2EE6 maybe you can try primefaces and the component "Multimedia", but this component depends sometimes of external plugins (flash, windows media, etc), but it's an option.
PrimeFaces - Multimedia
Or if you can't use Primefaces, maybe you can try doing a different approach using JQuery and HTML.
JQuery - HTML5 audio controls
Java Script - play audio with JQuery
I hope, this help you. Good Luck.

Related

Primefaces 2.2.1 with FileUpload from Primefaces 3.0

Related to the last comment on this question, i would like to know if anyone managed to use the HTML5-Fileupload of Primefaces 3.0 with an older Primefaces version.
We have a lot of trouble with the old flash-version of the fileupload.
I know that the best option would be to update the whole project to the new primefaces version but it´s not possible for this project.
This is not going to be trivial. That you're already asking this question already indicates that it's going to be a long journey. I'd rather use a barebones and to-the-point file upload component of another component library such as Tomahawk's <t:inputFileUpload>. It only doesn't support asynchronous uploading and you need to make the submit button of the form a non-ajax one, but it does the job you want it to do without much hassle.
You can find in this answer detailed step-by-step instructions how to integrate and use it in your project: JSF 2.0 File upload. In case of PrimeFaces, you only need to make sure that you have removed PrimeFaces' own file upload filter from the web.xml, otherwise it would consume the uploaded file before Tomahawk's own filter get the chance.
Thats very difficult, I have many problems with fileupload and finally migate to 3.0 but witch are problems?.
If you wanna to change fileupload you will can change source code in library is not very smarted if you desnt know jquery ui o you can use other framework or use directly.
http://www.matlus.com/html5-file-upload-with-progress/
good luck

Successful use of websockets with Glassfish and a rich component interface

Has anyone successfully implmented a Glassfish 3.1 server with websockets and a rich component interface for JSF like RichFaces, IceFaces, PrimeFaces. And If so what is the easiest method or best way to do this? Primefaces requires Jetty, and I think IceFaces uses JMS.
I'm just trying to find a way to add server push from Glassfish to my view that will display a text stream as it is available in the client. I'd like to do this through a component UI of JSF but if it's possible to circumvent the framework while still being able to use it for it's javascript management and UI utilities that would work too.
GlassFish 3.1 is broken in terms of WebSocket implementation and support a really old version of the protocol. I recommend you try the 3.1.2 version. If you want to be "shielded" from Websocket/Glassfish changes, take a look at the Atmosphere Framework. The framework take care of all those change.
-- Jeanfrancois
why not using IceFaces for that? I do not know what does it use internally, but they have ServerPush. The library that is doing this is called IcePush. IceFaces are integrated with IcePush.
See http://wiki.icefaces.org/display/ICE/Ajax+Push+-+Overview
AFAIK now they are using long polling, but I hope they will switch to web socket as soon as it will be ready for enterprice.

Which Faces to choose

I am on the hunt for a extra component library to the core JSF 2.0 library. I need calender-pick, tabbed pane, tree view and other nice components to complete my Java EE 6 - Glassfish 3 project.
But I don't know which additional library to choose; MyFaces, OpenFaces, PrimeFaces, etc. I never tried any of them.
My most important requirement for the additional library I choose, is the footprint in bandwidth and memory it will make. It has the be a lightweight library, because the web-system is used by many users in the developing countries, where bandwidth is far from what we have in US/Europe. Plus it would be nice if there is some RAID editor tool for the web-designers people to use when designing the View/GUI part. Thought of Dreamweaver, but I don't know if it can render the components (JSF core and Faces libs)?
What additional Faces library do recommend me to choose?
RichFaces seems suitable option. You can use JBoss Tools (Free) as WYSIWYG IDE. It is being actively developed and maintained. The new version 4, will work even better with JSF2.
To conserve bandwidth you may need to look at compression techniques on static resources.

Play Sound Using HTML 5 on Web Application

I'm building a web application to support RPG games, like Dungeons & Dragons. It's
like a AJAX chat room with dice rollers, avatars, shared information, character sheets and
so on...
One of my desired features is to let the game master to play music to all game members.
How can I implement that?
I'm building the application with Asp.NET, using C# 3.5.
In the client side I'm using jQuery (latest version).
I intend to avoid Flash and Silverlight (even if the music resource will be available to
some browsers only).
I tryed to use ogg format, but I don't know how to make it work with my own audio
files. Do I need to implement a stream or something?
The application already is online. If someone want to see it, let me know. But
it's only available in portuguese (Brazil).
Any tip will be apreciated.
You have a better chance of integrating the sound if its a mp3, then using javascript or HTML5.
HTML5 Code:
<audio src="anyone-there.mp3" autoplay controls></audio>
Read more here - http://www.html5laboratory.com/playing-with-audio-files.php
HTML5 is not supported by many browsers, so using a javascript to play the sound would be alot better.

Wicket vs GWT - Advice needed

I am developing a Java EE based web application. We have a very limited time to come up with a alpha version and trying to decide on a web framework to use. It has to be something easy to learn but powerful. Standard JSP/Servlet is not an option here due to the time it takes for the development. Appreciate if anyone could advice. Current options are Wicket and GWT. (JSF is also an option)
Wicket is component-based and comes with a bunch of standard components (like pagination, auto-complete, data grids, form handling etc.). If you want to create a standard panel (with the possibility for easy re-use) just create your HTML fragment to use a template (with wicket:id attributes wherever you want to bind dynamic content or sub-components) and a corresponding Java file. Furthermore, you can attach specific CSS and JS files.
In my opinion, Wicket development is good value (functionality) for money. And you get a lot of built-in AJAX functionality without even writing (not reading) any JS. E.g., change the model for a component, attach the component to an AjaxRequestTarget and the panel is automagically repainted via DOM manipulation.
For a quick overview and intro I recommend Wicket in Action by Dashorst & Hillenius. (And don't miss out on other great resources.)
Everything depends on your application. I don't have experience with Wicket, not much with JSF. I have big experience with GWT.
GWT is good if your application has to be mostly dynamic. In GWT you can change everything on the page not even calling the server. GWT is compiled to Javascript. On the other hand, if you have big project, it is quite frustrating if your application in development starts few minutes, because it has a lot of code to compile to Javascript. My opinion: it is not good for big projects.
If you don't need to change your pages so much client-side, I would use JSF2 (or Wicket, if I knew it).
Have a look at this comparison of Wicket and GWT, this may help you decide for yourself:
Wicket and GWT compared with code

Resources