added java script code to call getAllMedia service