My ear speaker doesn't detected in my Angular app (using enumerateDevices) - javascript

I am building a project with Ionic 5 / Angular.
I want to build a voice call app, which needs to access my phone ear speaker, not the loudspeaker.
The problem is when I fetch my device's audio output using enumerateDevices(), I don't find any other audio output besides the default audio output (the loudspeaker itself).
I want to attach the HTMLMediaElement using .setSinkId() to the ear speaker's device ID, but didn't find it. Is there any native plugin or workaround for this? Or is it just my phone that doesn't support it? Currently, I am using Samsung Galaxy A51.
Thank you.

Check this Plugin: Github Repo
NPM : Npm LInk
Usage:
AudioToggle.setAudioMode(AudioToggle.SPEAKER);
// or
AudioToggle.setAudioMode(AudioToggle.EARPIECE);

Related

Get live audio and video preview in reactjs

I am trying to develop a feature like google-meet wherein it let's you test the audio and video by previewing it through audio bar fluctuating as well as input video and testing speaker along with letting you select the appropriate input channels in a react application without using any external sdk or package or library.
Can somebody help me out in the same?
I tried looking up in github and web but no solution so far.

i having trouble building expo app for iOS. Why can't i build the app for iOS

I have an expo application and i'm trying to build the app for iOS.
I'm getting this error. Although I enter the right apple id and password. I still get the same thing over and over again.
Can someone please help?
It does not work work this way.
Apple account is not enough, you need to create distribution certificate and development signing also.
For building iOS app, do it from Xcode. Details are given in apple developer documentation. Also you will not a get .app file, you will get a archive which will be used for distribution

Storing video clips for react/phonegap app

So I have an idea for an app that'll include numerous short video clips. 1st question, is it possible to publish a React/NodeJs/MongoDb application on the android app store using PhoneGap/Cordova? 2nd question, assuming that the first question is possible, how and where would I store/call these video clips for the app?
I've never developed on this scale, any and every tip is appreciated!
Thank you.
I have worked on an application where i had to store small intro videos and pictures of a product, here is what i did and what you can do as well (of course you can choose other technology stacks)
What i did was use native Android Development(Java) for the android app and use PHP(Lumen) for backend where i store my videos on Cloud Storage on GCP.
You can build & publish your android app with PhoneGap(or Cordova choose which ever you are familiar with) and send the videos to your server for storage, your server can be built with NodeJS and MongoDB.
But if you haven't yet checked out Firebase i highly recommend it since it will remove many of the backend work(like uploading a video etc) and make development faster

How do I run an app on a real iOS device using Expo?

I am using Expo to run my application. I am able to see two options in Expo XDE:
open on iOS simulator
open on Android
I want to run my app by directly connecting to my device. Is it possible with Expo?
Yes, it is possible, and quite easy to get it running.
Step 1: Open Expo XDE, and click on the gray cog to change host mode to LAN. Make sure you enabled Development Mode. You'll see an URL right in front of you. Wait until packager to start running.
Step 2: Open Expo App in your mobile device, and click on the second tab 'Explore' and enter the URL that starts with exp://192.168... This is a local connection to your computer. You will see your app running in a minute.
Make sure your phone and computer are on the same WiFi!
For further information, you may refer to official documents here.
As the Expo Client App is updated due to new Apple's approval requirements, please follow the steps below to launch the App in a real iOS device:
Connect both your computer and your iOS device with same Wi-Fi
In Expo XDE, select Host > LAN (please refer to eden's answer)
Open MobileSafari in your iOS device. Type the URL shown in Expo XDE (should be something like exp://192.168.123.123:19000). Alternatively, you can click "Share" button in Expo XDE to show a QR Code. Use Camera App in iOS (iOS 11+) or any QR code reader (iOS 9 & 10) to scan the QR Code.
MobileSafari, or your QR code reader / Camera App, will ask if you want to launch the App in Expo Client App, select "Yes"
Your project will be loaded accordingly.
Hope it helps.
If you are looking to run a native build without using Expo Go on a physical iOS device (not a simulator), you can use the following code:
npx expo run:ios --device
This is useful in cases when you need to test notifications, native code, etc.

Implementation workaround for audio issues for Cordova exported Construct 2 games

I am creating a game using Construct 2, but on previewing on Android smartphone, I found Audio playback and delay issue:
This is possibly the curse of Web Audio API in that many browsers require user to touch the screen first or no music will be played. Worse, if another music is to be played, the user must touch the screen once again. This is "by design" of these smartphone browsers. Only Firefox seems to allow music to be played without user initiated touch.
I've seen that this issue has been covered for several times (ex. Website HTML 5 Audio Autoplay and https://stackoverflow.com/a/22331782/144201) and some of the possible suggestions include using other audio javascript libraries entirely such as SoundJS and howler.js.
Has anyone have experience bringing in such audio library that could solve the issue above for Cordova Android export option? Does it work for all Android devices? In fact, can anyone provide me a link for a HTML5 game/page/app, exported with C2 that uses such audio library and play music without requiring user's initial touch on Android so I could check? I just want a confirmation that this is truly possible.
Or is there a more elegant way for Construct 2?
Previewing on browser has the "user must touch screen once" issue because of it is "by design". But if the C2 app is exported via Cordova and uses Crosswalk, the game can play the music without requiring the user to ever touch the screen first.
See https://www.scirra.com/tutorials/809/how-to-export-to-android-with-crosswalk . Although the tutorial is outdated for the current Intel XDK, the instruction is more or less the same. However, the newer C2 versions also create an .xdk file upon Cordova export. In the Intel XDK, you must "Open an Intel XDK project" instead of "Import an existing HTML5 project". See https://software.intel.com/en-us/forums/intel-xdk/topic/607195 for more info.

Categories