webRTC video chat using Firestore - javascript

The code lab explaining webRTC and firestore is not clear enough to me.
https://webrtc.org/getting-started/firebase-rtc-codelab
I am having trouble with the final collectICECandidates step. Where should I be calling this function inside the code and how will I get the local and remote parameters required for the function?

I also needed help setting this up. The remotevideo was blank, and I got the 'Got room' in the console when I tried to connect.
To solve this, I found this on the Github's Solution branch:
https://github.com/webrtc/FirebaseRTC/blob/solution/public/app.js

You can find a corrected description in the following fork:
https://github.com/meldaravaniel/FirebaseRTC
And also there's a solution branch, were you can download the whole file from.

Related

Google Cloud Function 'node-pre-gyp/lib/pre-binding'

EDIT: I found the issue, when I copied the code I also duplicated the function. So I had cloud function "A" and "A Copy" and whenever I would pass information through the respective Pub/Sub, both functions are called and only one goes successfully through. I only did this because I thought having backup code somewhere would be safer and didn't expect it to make it not work.
So I've had a Google Cloud function running for the past 4 months.
Never any issues.
It uploads data I pass to it to FireStore.
I went to edit the code, but before I edited the code I made sure to backup the old code **index.js** and **package.json** just incase something broke.
Added a couple of new lines of code and of course the new code wasn't working so I reverted back to the old code.
However now the old code isn't working now and I'm getting:
Error: Cannot find module 'node-pre-gyp/lib/pre-binding'
so I commented everything and debugged as much as I could and found:
db.collection('LiveExamples5').add
({
Device: split[1],
Index: split[5],
Temperature: temp,
Humidity: split[9],
Raw: split[11],
Resistance: split[13],
VOC: split[15],
VDD: split[17],
Time: Timezz,
});
This is the piece of code that uploads the passed data to Firestore causes the error.
It's strange since this is the old code it's now causing this error and not uploading anything to FireStore now.
I'm not even sure how to install modules into Google Cloud functions.
Any help would be greatly appreciated.
Try adding the dependency of node-pre-gyp to the package.json file.

URL address changing from localhost:3000/home to localhost:3000/home#_=_

I configured my project first with passport-google-oauth20 authentication and it was working fine.
I added the passport-facebook after that and its working fine as well, however, after logging/registering with my FB account my redirecting URI which is supposed to be "http://localhost:3000/home" shows "http://localhost:3000/home#=" instead. It isn't showing any errors in the console and also working as it is intended to. I've got no clue what part of code I'm suppose to share with you guys as the functionality of the project is intact, so please let me know the snippet which may help you to better understand the issue.
This is not a problem itself.
https://github.com/jaredhanson/passport-facebook#why-is-__-appended-to-the-redirect-uri

Facebook sdk.js returns 404 error

My web-app has the Facebook JS SDK implemented.
Yesterday, everything was working fine and without any modification on the code, the script request started to return 404 errors.
When I try to access it directly, this is what I find:
Facebook Status shows that the API everything is OK.
Instagram's embeds.js and Facebook's debug SDK are also returning the same error:
Does anyone knows what it happening? I've tried accessing these files using my 4G network and the same error is displayed.
I'm based in Dublin, Ireland.
I figured this one out.. it seems the .net isn't working anymore.. I used ".com" instead:
Use https://connect.facebook.com/en_US/sdk.js
instead of https://connect.facebook.net/en_US/sdk.js
It is related to this bug, subscribe to get updated: https://developers.facebook.com/bugs/949091578557056/
There is a workaround to use .com instead of .net.
Edit: The bug is fixed now.
I had the same problem. Use //connect.facebook.com/en_US/sdk.js url.

.htaccess configuration for HTML5 History API

After several days of digging at the HTML5 History API, I found this great working example that suits my needs https://github.com/pinceladasdaweb/html5-history-api
However, when trying to run it on my local server/web hosting, I get an Internal Server Error, which leads me to think that there's something misconfigured in the .htacccess file.
Looked up at the Apache Error log and confirmed my theory, this was what error line tells:
"[...]
.../html5-history-api-master/.htaccess:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a
module not included in the server configuration"
I'd like to know if I need to make specific configurations in the server to make the example run properly.
You can see a working demo done by the owner here: http://www.pinceladasdaweb.com.br/html5-history-api/
Any help will be really appreciated.
Thanks!
This is what I have done to make it work.
1- As Panama Jack said in the comments, the answer of what was happening was in the log file wamp\logs\apache_error.log
[...] /html5-history-api-master/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
2- I enabled the rewrite_module on my local server (see Hardik Thaker for your visual reply to this post!
3- My web hosting is GoDaddy, I found out that I had to tweak the .htaccess file to make it work. This last post saved my life!
Hope it helps!

Hosting phono (jquery softphone plugin) dependencies locally?

This may be too obscure a question, but perhaps someone can spot what I'm doing wrong.
Phono (jquery plugin for javascript/flash-based softphone built on top of Tropo/Voxeo) loads a couple of dependencies from the phono.com servers. Namely,
flensed.js
checkplayer.js
swfobject.js
phono.audio.swf
I would very much like to avoid loading these dependencies from an external server (for obvious reasons) and going by this thread on their forums (which I can't register for because it appears every possible username has been "taken") , it should be possible to host them locally.
Here's a prettified source for the main jquery plugin. Maybe I'm just bad at looking, but I could not find a commented, un-minified version either in their full SDK or on github.
So after changing
base_path: "http://s.phono.com/deps/flensed/1.0/"
and
swf: "http://s.phono.com/releases/" + Phono.version + "/plugins/audio/phono.audio.swf"
... all dependencies seem to load just fine, phono successfully grabs a session ID and chats by SIP appear to be working. When I try to dial out or call the session id/SIP, however, I get a javascript error:
Uncaught TypeError: Cannot call method 'start' of null
referring to line 770 : h.start().
this.$flash.play(g, j); appears to return null or undefined. I suck at javascript and can't figure out why.
EDIT - if anyone would be so adventurous as to try this out, you can just grab their "kitchen sink" demo and slap it up on a server without much hassle.
Okay -- this is ridiculous and I'm an idiot for not catching it sooner.
Flash was trying to load the ringtones off my server at the URL that requires authentication. Unfortunately, flash is not a user with a valid session. Hence, flash was grabbing big handful of nothing. Sorry.
You can download the PhonoSDK and all of the samples (including the kitchen sink demo) and run it on your localhost. Here's the link: http://s.phono.com/releases/PhonoSDK-0.2.zip. It's open source, do you can also fork/contribute to the project as well - https://github.com/phono
I just tried it using Apache on my localhost it worked without editing anything.

Categories

Resources