erich.wanker Posted October 9, 2019 Share Posted October 9, 2019 Hy, short question .. if i start my UniGui App on Android/ChromeBrowser as a "Progressive Web app" - is it possible to play a sound on every "touch" event ..? .. .. so the user experiance is more "App style" ;-) Quote Link to comment Share on other sites More sharing options...
mhmda Posted October 9, 2019 Share Posted October 9, 2019 Yes but you have to d it manually Quote Link to comment Share on other sites More sharing options...
asapltda Posted October 9, 2019 Share Posted October 9, 2019 tks mhmda Hello Any example or idea of how to do it thanks Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted October 10, 2019 Author Share Posted October 10, 2019 SOLUTION FOUND yes - a manually thing would work ;-) function playAudio() { var a = new Audio('files/sound/click.mp3'); a.play(); } On the things what should click: ClientEvent / extEvent : function click(sender, eOpts) { playAudio(); } BUT FOR ANDROID: ..i found a solution :-) for every "touch" window.addEventListener('touchstart', function playAudio() { var a = new Audio('files/sound/click.mp3'); a.play(); }) Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted October 10, 2019 Author Share Posted October 10, 2019 QUESTION: performance is bad ... the "var a = new Audio.." is allways creat a audio-element on every touch-event how can i make the click sound FASTER - it takes 0.5 seconds from touch to sound .. a test with following lines makes it NOT better: <script> var a = document.createElement('audio'); a.src = 'files/sound/click.ogg'; window.addEventListener('touchstart', function playAudio() { a.play(); }) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 10, 2019 Share Posted October 10, 2019 20 minutes ago, erich.wanker said: <script> var a = document.createElement('audio'); a.src = 'files/sound/click.ogg'; window.addEventListener('touchstart', function playAudio() { a.play(); }) Where do you use this script? Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted October 10, 2019 Author Share Posted October 10, 2019 inject javascript in ServerModule ... CustomCSS .. please look at screenshot - last 7 lines .. Quote Link to comment Share on other sites More sharing options...
asapltda Posted December 19, 2021 Share Posted December 19, 2021 good morning mr. erich.wanker, I have copied your code but I do not know where to place the instruction to reproduce the sound. My need is to read bar codes compare it with the database, if there is to emit a sound of correct or incorrect which must be issued very fast, try another method but it is layers to emit 10 times on the mobile, in windows there is no problem. It is possible that you give me an aid of what code and / or example I should use to get the sound to be reproduced. thank you for your collaboration Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.