Change primary audio device via JavaScript - javascript

I'm attempting to create an audio router app in Electron. I used DetectRTC (https://github.com/muaz-khan/DetectRTC) to get the list of audio devices on the computer.
How would I go about changing the Windows default audio device via JavaScript, or is it even possible?

Forgot about this project but as far as I know it's impossible to control os level audio settings from the browser. I think a good option for this would be to use C# and Windows core libraries, as in this implementation. Then, the C# could be run within an electron app using electron-cgi.

Related

What's the difference between Cordova and Windows 10 Javascript Apps?

In Visual Studio 2015 I go:
New Project -> Under Javascript/Windows -> Blank App (Universal Windows)
It then creates a new app that has an .html file, a .js, .css, etc.
I then can access system level things via an object that's exposed to javascript.
Now in order of Microsoft to have implemented this I'm guessing my app is hosted within a webview of some sort.
Now let's take Cordova (or Phonegap), I create a windows cordova app and this is a windows app that has a hosted WebView within it. (or does it? atleast that's what it does in iOS and Android).
So isn't this redundant? If my app itself can be a WebView (by making a javascript windows 10 app). Why would I want to host ANOTHER webview like cordova?
Or maybe I'm not understanding something..
Windows 10 Javascript Apps (Also known as WinJS) is a way of building native Windows apps with web based technologies. WinJS provides libraries that provide direct access to the device, underlying OS and framework.
Cordova apps are also built with web based technologies and run inside an embedded web view. Cordova provides a set of libraries for accessing details on the device but these go through another layer that is specific to the OS. While WinJS is only for Windows apps, Cordova apps can, for the most part, be easily rebuilt to run on different platforms.

Using a scanner connected to a pc in a web application using php,javascript

How can I use a scanner connected to pc in a web page i'm created using php and javascript
Javascript only interacts with your browser, i don't now if is possible that your scanner act as a WebCam, in this case you can use HTML5 api for webcam
Php or any server-side language is able to interact with the server and run commands , so is posible in someways if your scanner device has some command-line way to scan , but keep in mind this will only work with an scanner attached to the server where this script is host, this probably works for you if you are planning to create this for a home network o company network, mostly like a Web GUI for the "home/company" scanner
if you are thinking to do it to scanning app to the "world", They only way i can think you are able to do it, is probably creating a Java Applet , but nowadays is very common that web browser block java applets
This is not possible directly with JS or PHP, but you can try scanner.js
click here for demo and documentation
Edit:PDF Document for Scanner.js . Just include .js and using javascript callback functions to perform action.

HTML5 and javascript in xcode

I'm quite new to xcode, because I mostly work with JS and HTML5. I've decided to create a simple webview app that enables me to work with JS and HTML5 (going to put it on Github asap)
Now my question is about accessing certian iPhone features that I cannot use in Safari or Chrome (the reason why I'm creating this).
So the question is: is this possible? for example, I can't access the camera (as a fullscreen background I mean) in an iOS browser, but can I use it in webview?
You need any method of communicating between UIWebView and the containing app. There are libraries out there that do just that, some better some less. In case you do not want them... So to outline the techniques to do that:
App talking to the webView - using [webView stringByEvaluatingJavaScript:...]
Webview talking to the app - using url directives. Which is essentialy window.location = ... with custom fake urls, and then parsing the NSURLs in the delegate method webView:shouldStartLoadWithRequest:navigationType: and of course returning NO to prevent actually navigating to your fake urls.
If you find that you are missing consecutive URL requests, you could write a JS function that takes the URLs, puts them all in an array, pops one by one and sending them to the browser in a setTimeout(..., 0).
You need to use something like this - Cordova or PhoneGap ( Both are the same thing )
"Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript. Combined with a UI framework such as jQuery Mobile or Dojo Mobile or Sencha Touch, this allows a smartphone app to be developed with just HTML, CSS, and JavaScript."
Here is a description of all the device features cordova or phonegap allow you to use - Plugin API's
Yes, is it possible, but using a web app container like Phonegap.
If you need more info how install it visit this web.

App switching in UI Automation

Is there a way to switch between applications using UI Automation in instruments?. And also to change wifi settings using the same? Any help will be greatly appreciated.
There is not currently a way to change connection settings. Although, technically if you are using the simulator you could launch an external script using UIAHost.performTaskWithPathArgumentsTimeout to change the host computers internet settings.
Switching between apps is also not possible for the reason that they don't want you controlling apps that aren't yours. However, if you own both apps I suppose it'd be possible to launch an external script to launch one app in instruments and once that test is over launch the second one. This would only work in some cases though.

Is localStorage safe? Can I access it from another app?

I am making a jQuery Mobile and PhoneGap app.
I am about to save some data to local storage. I am wondering if it is safe on mobile browsers (Android, iOS and windows). On PC I am able to check the values in FireBug. Is it possible somehow on mobile devices? Can I access in app A data specified by app B?
Thanks for help.
At least in iOS, if it's a phonegap app the localStorage is only accesible from the app.
To check values while you are developing, you can try debug phonegap.(only works on webkit browsers). If you put a name there, it creates a script tag to include in your index. If you include that script tag in your index and execute the app you can see a remote web inspector for your app.

Categories

Resources