Webrtc with openvidu device already in use when it’s not - android

Having a strange issue on one android phone for a website using openvidu for streaming.
There is a switch camera function which alternates between front and back cameras. This is accomplished by getting all the available devices say on the back and selecting the last one in the array and then publishing the stream to that device.
I’ve tested this on windows, mac, multiple iPhones in safari and chrome and multiple android phones in chrome and works perfectly.
However one android phone is behaving strange that when switching to the environment camera it says that the device is already in use, but it can’t be in use, the phone literally rebooted and no other app loaded and activated the camera.
Not sure why this is happening? I was thinking maybe the code should stop each device before the switch happens? But why would it say it’s in use when it’s not?
Update
After some investigation this seems like an annoying issue with huawei phones where one of the back cameras has the same device Id as the hands free audio input device, so when my code is selecting a back camera that works everywhere else it thinks it’s in use due to the id being used by the audio input.
So it looks like the only way around this is to bypass the selection of this particular camera if it’s id is the same as an audio input device and select a different back camera instead. Annoying!
Update 2
Actually it seems a bit more than this, the phone has 3 back cameras but 4 devices show up as video input, it looks like there is a bug on the device where it thinks the audio input is the same as the video input so it’s adding an additional camera to the device list, unless this is because somehow on that phone the hands free device includes a camera. Really odd
Update 3
The phone is a p20 pro and I also noticed it actually has 2 audio input that share 2 video input device id instead of all being unique which then causes another problem when try to use a different video device id.

Related

How to use WebCam as phone camera?

On the internet there is a lot of information on how to turn the phone into a webcam, but I would like to do the opposite, that my webcam become my phone camera.
To be more specific, some apps ask to take a live photo, on the spot, without the option to select from gallery, but I would like to get around this, App Cloner does this with the fake camera feature, but it doesn't work in almost any app, so they're looking for an alternative.
I thought of the following: On my mac, I can use software like CamTwist and ManyCam to create 'fake' webcam, CamTwist/ManyCam lets me pipe custom content (such as images or video) to that webcamera. So I thought of using emulators like BlueStack among others, and then these emulators would connect to my web cam and get the personalized content, the problem is that most apps don't run on emulators, at least the ones I need...
So following this logic, I would need to inject custom content into my mac camera and transmit this image to my android phone somehow.
If not possible, is there an alternative?
Note: fake camera android apps on play store not working.

Using audio recorder at android simulator

I want to use an audio capture feature at my app. I followed this link at developer.android.com.
I'm using Android Studio 1.4 and a Nexus 5 with Api21 as virtual device. At developer.android it is descripted that it's not possible to use the audio capture feature with an simulator:
Note: The Android Emulator does not have the ability to capture audio, but actual devices are likely to provide these capabilities.
But is this an information that is up to date? I'm able to use the record button but the activity crashes after pressing stop. I can see the audiorecordtest.3gp file on the simulated device and if I save it to my computer I can play my recorded audio. The crash comes without any shown exception. If I ask for
context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_MICROPHONE);
I got back a true. It seems like the simulator is able to capture audio but can't handle correctly the stopping of it? Is there a way to get around?
One aspect of Tamper Checking involves testing for an Emulator running your app...
In THIS article (Paragraph 4.1), Emulator detection is described... The tests detect many emulators, but throw some "false positives", depending on the device.
False positives render some emulator test's, described in the article, not appropriate for production, but are fine in a test environment where you know your devices and their test responses.

Modify firmware of noname android tablet: first steps

I want to develop a HTML5 app to control doors, lights and other things in my garage. The frontend of will get displayed on a 24/7 turned on screen, that really only displays the app (kiosk mode). So there will be really only the app, no browser controls like back and forth button or url bar, and also no notification bar or back and home buttons of the device. Just the app.
For this I considered 2 options:
Doing it with a raspberry PI & connect a touch screen to i
Doint it on a dead cheap noname Android Tablet
Since the 2nd option is much more elegant from the hardware point of view (everything I need is already built in) I decided to try this first and bought a 70 USD Prestigio Tablet.
But since I'm no android dev, I'm not sure how I can even modify the stock firmware that's currently installed on the device.
As far as I can see, the bootloader is unlocked and ready for flashing a modified firmware image.
And here comes the question:
How can I get the device's currently installed firmware image? Do I have to contact the manufacturer for this or can I extract it from the device directly?
If I get the firmware image, how will I be able to modify files in it?
Or do you think I got the wrong route?
You need to find sources of firmware for your specific device. I bet manufacturer would not provide them. For Nexus devices it is easier because there is AOSP (android open source project) which gives you an opportunity to build a firmware. You can also check specific forums like 4pda.
But there is another way - to make a KIOSK mode for your device example. I'm not sure how does that fit into requirements. Also You can make your app as Launcher app and live with that :)

Opening of Front Camera and Back Camera simultaneously?

How can i open both front camera and back camera at the same time in android? Is it possible?
I have tried tried but my application stops unfortunately.
Please Help..
On some devices, e.g. based on Snapdragon 805, you simply can. In other cases, the manufacturer chose to block the naïve approach, but the native camera app knows how to do it, and, with some reverse engineering effort, you can reproduce their approach (I had partial success with Samsung S4 before I lost interest in that project).
But on most of available phones, there is a physical restriction: the two cameras share the same bus, and cannot be opened simultaneously, no matter how skillful you are in software.

View mobile screen on PC using adapter

I need to view the live screen of my Android mobile on a Windows PC. My Android phone has a mini-HDMI output. Is there any adapter/software that helps me to achieve this? The applications that I found after searching needs the device to be rooted to control it. I don't want to remotely control the device. I just need to get the live feed from the mobile.
Actually, there are some relatively affordable HDMI-DVI adapters on the market. Couple them with a mini-HDMI to full HDMI cable and you've got yourself a decent hardware setup.
Some notes:
HDMI carries audio and video, while DVI carries only video. However, the two have no difference in video quality, and they use the same encoding.
as Mgamerz said, support for the HDMI outputs on Android phones has been, thus far, dismal. Your phone might have the port, but your ROM might not support it. Furthermore, some apps won't even acknowledge the existence of the HDMI, again, because so few phones have them.
From a hardware and an encoding point of view, this is COMPLETELY possible, but from a software point of view, it is likely IMPOSSIBLE. If you figure out how to do what you're trying, definitely tell as many people as possible.
You're going to need HDMI mirroring, which means you'll need a high end device (most likely dual cores), and support for it is going to have to be built into the rom. I own an atrix, and developers have slaved for months to get HDMI mirroring on it, but only some progress has been made.
Otherwise, unless your device supports it, you won't be able to do it. It's dependent on hardware too.
Edit: There might be some apps to do it but I doubt they will achieve what you seek. HDMI mirroring typically doesn't go past 20fps either (on a dual core 1Ghz).
To use the HDMI port, you'd need something that can accept HDMI input.
Very few computers can do so (except possibly some smart-tv type boxes).
However, there's a good chance that the monitor connected to your computer can. It might even have a spare input.
In other words, displaying your phone's output "in a window" on your monitor is extremely difficult. But by pushing a button or swapping a cable, you may well be able to display your phone's output on the entire monitor, in place of the computer's.
Practically speaking, if you need it in a window, or the device doesn't have HDMI out, the most common solution seems to be a high-end webcam in a fixture to aim it at the device. I saw a presentation that was delivered this way, displaying on very large flatscreen TVs, and didn't even realize that the slides were coming from an Android tablet as seen by an overhead camera until the presenter picked up the tablet and slid a phone into it's place.
http://mymobiler.com/?cat=3
Try this app from mymobiler. it works on motorola atrx 2 with android 2.3.6 rooted.
The site lists only a few supported models but it seems working on other models too.
You can get the full access to the mobile screen in your windows application windows.
It can also capture screenshots and take video of the actions on the screen.

Categories

Resources