Thursday, September 27, 2012

Glassfish stream mp3 for HTML5 audio to IE 9

By default, Glasshfish handle the MIME-TYPE as audio/x-mpeg for mp3 file, thus IE 9 can not play the mp3 with HTML5 audio object.

The solution is:

Open the Glassfish/domain/domain1/config/default-web.xml

Find

    mp3    audio/x-mpeg

and alter it to

    mp3    audio/mpeg

Restart the glassfish & now IE 9 should be able to play mp3 file without problem.

Don’t forget to define following tag in your HTML file

<!DOCTYPE html>

Tuesday, September 25, 2012

Launch RDP from Web Browser

This script allows you create a link that can open a RDP session by passing a server address parameter

eg.

Open RDP

function rdp(address){	try{		var rdpexe = 'C:\\WINDOWS\\system32\\mstsc.exe';		var ws = new ActiveXObject('WScript.Shell');		ws.Exec(rdpexe + " /v:" + address);	}	catch(e){		alert("This link will try to launch RDP session from web browser\n"+			  "1. Please use Internet Explorer 7.0+\n"+ 			  "2. Go to Tools > Internet options > Security > Trusted Sites & click \"sites\" button.\n"+			  "3. Add *.your_domain to trusted site\n"+			  "4. Click Custom Level & find the section \"ActiveX controls & plug-ins\"\n"+			  "5. Select Enable for \"Initializing & Script ActiveX controls not marked as safe\"");	}}