We have developed a webchat app that notifies the user if the message was received with firebase notification library, but we are totaly unable to play any sound when the notification arrives, that aparently is happenning due to a chrome performance algorithm
But we notice whatsapp webapp is able to do that, so, does anyone knows how to play a short notification audio when chrome tab is not focused?
Use a JavaScript Webworker https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
Basically a Webworker is like a Backgroundtask. So your Tab doesn‘t need to focused to play the sound. Maybe that helps
Related
Hey guys am trying to create a streaming system using javascript where the system can receive both sound playing from my pc and sound entering my pc like a mic and then streaming both sounds live on the browser allowing multiple users listen to it. this is more like a radio brocasting session where you can play sound and also talk same time and the listener gets both sound without any latency or if any it shouldn't be noticed at all is this possible to be achieve using javascript - node js and react? if yes any guide at all with help thank you.
I'm trying to implement a sound on my appliaction when it receives some updates (like whatsapp web) using Audio Context API (currently using howler.js).
But I have a problem when the user didn't interact or refresh the page:
The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page
It works after the user does some gestures, but after refreshing it asks again and doesn't play the audio.
I looked on whatsapp web, and I realized that it's chat sound always works even without interacting and after refreshing the page.
How can I resolve this issue? Is there another way to solve it?
I think you did not notice that WhatsApp does not make a notification sound until you interact with the page, and the same note that appears for you appears on the WhatsApp web page if you receive a notification without interacting with the page (See the last log in image bellow):
Autoplay is only allowed when approved by the user, the site is
activated by the user or media is muted.
Here is the power of the frontend frameworks (Like Angular) that make all website as a single page, as you only need to interact once so that you continue to receive notifications sound even when you change the page.
After a while the connection is disconnecting while the application is in the background. I’m testing on Android how can i prevent disconnect problem.
I ask this question here react-native-webrtc but i couldn't implement any solution.
Can anyone please provide a example with https://github.com/oney/RCTWebRTCDemo because i can’t understand exactly how to use react-native-callkeep or an Android ongoing notification.
I tried to use backgroundjob for keep app alive but it's work only short time period like 5-10 minute.
When your app go to background you should always close the webrtc connection due to safety, you can't leave the camera or sound open.
Why you want your app to be alive in background when webrtc is enabled?
Try this repo https://github.com/DimitrisTzimikas/RCTWebRTCDemo2
I am currently using RecordRTC to record an audio from user. It works perfectly fine! Except when the recording has been stopped, chrome seems to continually indicate that my web app is still using the microphone.
http://recordrtc.herokuapp.com/
The above link shows what I meant. After clicking the stop button, then recording indication is still on the browser. How could I get rid of it?
Much thanks,
Jason
I don't think you can remove that indicator after the user gives access to their microphone. Don't think of it as a typical recording indicator that tells you when you're recording. It's more of a security warning to the user, saying "Don't forget you gave permission to this application to use your microphone, because it may be sneakily recording you."
I'm developing a web app that shows a counter, and when the counter comes down to 0 I want to notify the user(The counter is on a server, so there won't be a problem with reloading the page).
If the user is on a computer, I'm using a popup for the notification, but if the user is on an Android device, I would like the notification to be shown even if the browser isn't open.(I'm using AngularJS if that would be any help)
Is there a way to do this? I rather not build a special Android app.
Thanks.
//G
I'm afraid no, there is no way to do that. When any android application is not active is... not active, frozen. The browser is not a service, so as far as I know it won't process anything while in background. Even it's possible the OS close the browser if it needs more memory than is available.