Twilio javascript client has no audio - javascript

I tried using the Twilio Javascript Client Quickstart and am having some audio issues. I am trying to place a call to a cell phone from the browser. In general, everything seems to work without errors. The issue I am having seems to be an audio problem.
Edge - The call goes through, I can hear the audio from the microphone on the client but I cannot hear the audio from the phone on the client.
Chrome - I cannot even get the call to connect because I cannot click the Call button. It seems to get hung up on the microphone permission.
Firefox - The call goes though but no audio on either end.
IE - The Call button and textbox too enter in the phone number on the client don't even display.
Does anyone have any suggestions? Thanks!!
EDIT: Based on the comments I tried to use the sample files without changing them. There were some errors and I had to add the bootstrap and modernizr packages in nuget. Same result. No audio.

Related

webRTC on Android browser output device problem after WhatsApp or GSM call

I am making this webRTC peer-peer single call application which works fine generally. But on the mobile browsers we are facing one issue on android chrome browser.
On android chrome when the call is in a process and there is another call coming in from WhatsApp or GSM. After receiving the call and when the call finishes we return to the browser calling page and it connects with the call again but this time it used my earpiece speaker instead of any other speaker and we are unable to change it manually.
The same thing happens when the incoming call is rejected.
We tried to detect the app moving to background and reconnect the webRTC connection on focus in which case we can switch to another speaker but this works only once and after receiving another call, this does not work either.
Reconnecting the socket connection also does not solve this audio device issue.
The only thing that works is the reloading the page, but this is not a good solution.
Anyone can help us to solve this issue without reloading the page. Any workaround would also be highly appreciated.
Thanks in advance!

Which browser event detects when your webcam turns on/off?

I'm currently developing a prototype that logs video chat information from third party services like Hangouts, Zoom, etc.
So far I'm unable to get a simple event to log to the console with navigator.mediaDevices.ondevicechange. Using the latest version of Chrome.
https://codepen.io/anon/pen/dqbNKR
I'm using this pen, and all I want to do is just log to the console when my video camera turns on/off. Is ondevicechange the right event?
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/ondevicechange
A devicechange event is sent to a MediaDevices instance whenever a media device such as a camera, microphone, or speaker is connected to or removed from the system. It's a generic Event with no added properties.
I know I can also look at streams of specific elements, but since it's 3rd party services I don't necessarily know which elements to look at.
So how can I detect when my webcam turns on/off in a third party app in the browser?
Thanks for help =)
As I was typing this I came across this, but need to test it.
How to check with JavaScript that webcam is being used in Chrome

youtube embed causes continuos get_screen_availability requests in net panel

reproduce:
go to http://jsbin.com/bules/1/
open console
go to net panel
see a lot of requests almost every 3seconds from youtube
With open console in chrome it causes memory leak after an hour or so.
Can someone explain why is that happening and why is this call so frequent?
The HTML5 youtube iframe do pulling every ~10 seconds, I guess they are doing it with some sort of socket with Flash and couldn't find a more reliable way to do it with HTML5 (eg: WebSockets are not implemented everywhere).
So this is just part of the normal YouTube HTML5 iframe behavior. Hopefully it will get fixed and replaced by a better system one day.
It's caused by a polling from the player. It checks whether I have my paired smartTV is turned on or not. So it can hide/show the remote-screen button on player.
I found this question when googling to solve the problem. I have the same problem (still, YT haven't solved in a better way). I had requests every ~5 sec. The client (FF) was sending the requests no matter if I had a youtube page up or not.
I found this is solution:
https://support.google.com/youtube/answer/3230451?hl=en
I couldn't manage to turn it off with the instructions for On computer, I had to do it from the TV. And the restart FF to get rid of it.

HTML5 base64 encoded audio on mobile devices

I'm writing a platform with an audio playback component. Audio is uploaded to the server as an wav/mp3/ogg file, and then (like the rest of our media), converted to base64 and stored within our redis database.
To play the audio back at the client side we make an AJAX request to the server for the base64 encoded audio. We have a desktop version that compliments the mobile application, at the moment audio playback works like this:
recording.sound = new Audio("data:audio/ogg;base64," + recording.audio);
recording.sound.play(); // this works
Today we started our tests on mobile devices, and have so far been unable to get it working, even on mobile browsers that apparently support HTML5 audio.
Any ideas? Or if this is not possible, is there a different approach we can take? Ideally there should be a mobile compatible version of the web app, and there has to be a phonegap version.
The reason might not be a technical one here, from Apple developer site:
In Safari on iOS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, preload and autoplay are disabled. No data is loaded until the user initiates it. This means the JavaScript play() and load() methods are also inactive until the user initiates playback, unless the play() or load() method is triggered by user action. In other words, a user-initiated Play button works, but an onLoad="play()" event does not.
same applies to Android devices.
read more here: Safari HTML5 Audio and Video Guide
But „audio/wav“ doesn't exist. See spec here: http://www.iana.org/assignments/media-types/audio
You should use „audio/vnd.dts“ for .wav file, „audio/mpeg“ for .mp3 file and „audio/ogg“ for .ogg file...
OK, try StackOverflow search, see:
https://stackoverflow.com/search?q=audio+codec+support+mobile+devices+html5
or https://stackoverflow.com/search?q=audio+codec+support+mobile+devices+html
or try Google
Some search results, that might be useful:
In search for a library that knows to detect support for specific Audio Video format files
or html5 vs flash - full comparison chart anywhere?

web app on mobiles with phonegap

I have a web application (chat room) in html + javascript that basically sends requests to the server every 5 seconds to check for new messages.
It already works on mobile but there are 2 main problems:
it does not beep (it works on pc) with new messages
when the browser is put on background, the javascript obviously stops being executed, therefore the connection to the server is lost and the client disconnected.
i was thinking of using phonegap not only to make it cross-platform but also to fix those problems stated above. would they be resolved with the use of phonegap?
thank you in advance.
phoneGap doesn't support custom push notification. it basically open a browser and expose you some native support via API.
in order to do some native actions like push notifications and/or sound playing i suggest you check out some of the plugins options available or even write your own for that.
Playing sounds can be done easily using the Media API. As for having the JavaScript run in the background it really depends on the OS. On Android the JS will continue to run if you leave the app via the home button but the back button kills the app so you would stop the JS. It is probably better to write a service that always runs in that case.
Alternatively you'd look at a push type solution to notify you of new messages.

Categories