WebRTC Session on Localhost - javascript

Using the PeerConnection Demo 1 Here: https://webrtc-demos.appspot.com/html/pc1.html Would there be support to run this over an XAMPP sever on Localhost and being able to connect two PC's together? It looks like there would be support, but I cannot get it to work. Any Javascript/HTML experts know what I am missing?

The demo you linked only works in my Chrome Canary.
Try using this: http://simpl.info/peerconnection/ and https://apprtc.appspot.com.
Adapter.js (used in the apprtc link) enables cross-browser usage, and easy transition when prefixes are removed from the apis - very easy to implement.
I have both running on a local MAMPP server and only the latter needed some edits to get local video working. exchanging session descriptions for my local apprtc implementation is something i hope to have done very soon!

Related

Fleek.co image upload not generating hash and hashV0

I was uploading an image using the safari browser, it does not return any ipfs hash.
While on the other hand, it returns the ipfs hash if I am using a desktop web browser.
Can anyone help me with this, or at least explain the process?
EDIT: we noticed you’re using iOS simulator. Based on that, we released 1.0.4 version for #fleekhq/fleek-storage-js that adds a fallback for case sensitive headers https://github.com/FleekHQ/fleek-storage-js/pull/6. Can you try this version to see if it works for you?
Please note that this service is based on Minio and the current authentication is only setup for calls from a server (not a browser for example). This is because it uses API secrets and we don't want to expose them in the browser. Having said that, will take a look at why our Minio fork is not sending the header in those cases (it just hasn't been a priority to replicate because it is not advised to use from browser like that).

Is there an easy reliable way to transfer a file over local network using Electron / Node.js / terminal?

Are there any built-in methods in Electron / Node.js allowing to transfer a file over local network to another device?
I want to be able to send files locally from one computer to another (through an Electron app), but I also want it to be able to send files to smartphones.
How do I do it? Is it possible to just create a temp local server and download the file from another device by opening the URL (e.g. 192.168.0.x:x/file.txt)?
I tried using https://www.npmjs.com/package/quick-transfer which does exactly that, but for some reason opening the link on another device doesn't do anything.
As painful as it is for me to suggest... I'd recommend WebRTC for this, for these reasons:
It will make a local connection, when possible.
It will work over the internet as well, if required.
You can work around any firewall difficulties with TURN.
You will have compatibility with browsers.
You won't be opening up some server to a file that anyone on the network can get... transmission occurs over a secured connection. (This doesn't mean you can ignore other security aspects in your application however!)
Sample code: https://webrtc.github.io/samples/src/content/datachannel/filetransfer/
Commentary: It's amusing to me that in 2018, we still haven't solved the problem of sending a file from point A to point B. Network Neighborhood in Windows was the golden age, and now it's all screwed up with this newfangled cloud crap. :-) Obligatory: https://xkcd.com/949/

How to run sample Threejs VR project using local server?

I am trying to run sample threejs project for VR using xampp local server in Samsung NOTE 4 device.In this phone, online threejs VR examples(https://threejs.org/examples/?q=vr#webvr_cubes) working fine,
but same example in our local server link(http://192.168.1.2/three.js-dev/examples/?q=vr#webvr_cubes) always returns "Your browser does not support WebVR".
Can any one give me suggestions or idea how to run that sample project using xampp local server
Thanks in Advance
At this time, WebVR is still an experimental feature (I assume you're using Chrome).
http://192.168.1.2/ is not seen as a trusted entity, hence experimental features are disabled.
However http://127.0.0.1 and https://threejs.org are allowed to use this feature.
To enable WebVR, go to chrome://flags/#enable-webvr and click Enable
If you want your users to be able to use WebVR today, you have to apply for Origin Trials by filling in this form.
Google will give you a token to add on your page. (Note that you will have to set up HTTPS on your server).
Alternatively, you can add a polyfill to make your VR work everywhere (not just in Chrome M59+).
(just include the polyfill before three.js)

Webrtc app not working on local host?

I am using a WebRTC demo application for screen sharing. The demo works perfectly fine but when I try to run the same code in localhost or my own remote server, the code doesn't run.
Any ideas on how can I fix this issue?
Screensharing in Chrome only works over an SSL connection(). You can use a self-signed cert and simply accept it in your browser(this is for Chrome < M36).
Also, for Chrome >M36 you must now use the Chrome.desktopcapture API and the usual way of modifying media constraints and enabling screen-sharing in Chrome internals will not work in newer versions of chrome.
The API is farely simple and MUCH more robust than the previous given option in the media constraints.

Recording Audio with HTML5 and getUserMedia in Chrome

I'm looking to record audio in Chrome without using Flash or Silverlight and then store it in a database or on a server using PHP and MySQL.
The only way I've seen this done is via getUserMedia and some JS in HTML5.
For example:
http://webaudiodemos.appspot.com/AudioRecorder/index.html
I got the source of github here:
https://github.com/cwilso/AudioRecorder
The problem is it doesn't seem to work on my localhost. In fact, the index.html that was included is exactly the same as the hosted version. The hosted version works, but when the same thing is run on my local machine it throws an error saying it can't getUserMedia().
Has anyone implemented something similar or have any insight? Thanks a lot!
For each browser it uses it's own prefix, so for chrome it's webkitGetUserMedia()
see Mozilla's page here for more info on the different prefixes:
https://developer.mozilla.org/en-US/docs/Web/API/Navigator.getUserMedia
I saw you mentioned localhost, but if you are trying to access the site via file:/// instead of actually using http://localhost (a web server) Chrome will block access to getUserMedia.
If you are trying to access it using file:/// then you need to open Chrome with the command line argument of --allow-file-access-from-files
The following gitHub project records audio to MP3 format directly from the browser using HTML5 and JS only.
It works both on Chrome and Firefox as of now.
https://github.com/nusofthq/Recordmp3js
For a more detailed look at the implementation you can read the blog post:
http://nusofthq.com/blog/recording-mp3-using-only-html5-and-javascript-recordmp3-js/

Categories

Resources