amirsanni / video-call-app Goto Github PK
View Code? Open in Web Editor NEWA text, audio and video chat application built with webRTC and Ratchet (PHP WebSocket)
A text, audio and video chat application built with webRTC and Ratchet (PHP WebSocket)
i have done all the things correctly
the chat works fine
but when i do vedio or audio call
it shows incoming call but when i answer the call nothing happens
no error in console
Hello,
Thank you for this library But I am getting an issue when I try to run "php server.php" Then I am getting error of
PHP Fatal error: Uncaught Error: Class 'GuzzleHttp\Psr7\Rfc7230' not found in C:\xampp\htdocs\video-call-app\ws\vendor\guzzlehttp\psr7\src\functions.php:792
Please help me to find out the issue.
When i get version from 04.04.2018 on master it doesnt work properly. When i call video or audio second user can't answer the call and ringtone is still ringing, something is wrong here. Some bug or something, I tried everything.... Then i pull commit "Bug Fixes" from 20.01.2017 and it works good. Uff... So, version from 04.04.2018 doesn't work properly on localhost and prod too. This is important information, because I lost 4 days on it.
I have created a server and app that allows me to use voice chat and text chat, but when i tried to use it with my friend that was in his house and me in mine, but when i am in one subnet on one ip address everything is okey, You can check everything on https://projectex.pl/coowork/voice_chat/comm.html?room=5575498
Is there any solution for this problem?
--
Edit #1 I want to add that i am using WSS protocol
Hi amirsanni
I downloaded your code and copied it in my htdocs folder made the required changes-
when trying to run from my localhost the chat room does not open up and it gives an error of object not found, although the comm.html file is there,
but when clicked on Enter Room simply new tab opens up with object not found error.
Please help.
I am not able to Locate ratchet.service on my dedicated server because i am not able to find path to where to place it as it is given into ratchet_as_a_service.txt. Please help me with it. Thank you
hi is there any video record option on both side i want record video during calling then save into harddisk
and its support only two users? or mor then two user allow?
How to setup it on live server? I mean how the server.php file will run so that chat can be initialize. Please, help
Hey, I have been programming for quite a long time but I probally will never be experienced to make something like this myself ever. Anyway I tried to set this up and got it working, but whenever I try to make a call, I can absolutely chat and things, even accept the call, but as I do anything, when accepting the call, nothing happens, the call seems not to start and even tho I clicked accept, the second side gets an error saying that there was lack of response from other side, what could this be caused by?
(It keeps saying setting your call up but nothing happens until the request times out)
I am unable to run this package, i am getting bellow error..... please guide me
Error:
WebSocket connection to 'ws://localhost/video/comm' failed: Error during WebSocket handshake: Unexpected response code: 404
Hello amir
I found a problem about video-call-app.
If I put it online, everyone can use the chat rooms.
For example, an anonym can make an url such as 'https://domain-name/video-call-app/comm.php?room=100' to enter a new chat room. Not only that, if he told above url to his friend, they can chat forever.
How to restrict the anonyms? or prevent them from using their selfmade urls to chat with others?
i tried it with Windows and Kubuntu, with both I am having the same problems. I followed the instructions, but somehow I seem to have missed something important. I've installed Apache 2.4 and PHP7 on my Kubuntu system. The PHP testfile which displays the PHP version is working fine, but when I do "php server.php" the cli does nothing, until I trigger an error by typing "localhost:8080/comm" in the browser. If I type in the recommended test-url from the instruction, the browser can't open the page. When starting the ratchet server, the terminal should display "server startet" I waited 5 minutes for the terminal to do anything on first start. And there should be a possibility to shut down the server, atm I use Ctrl + C to quit, not the ideal solution.
Hi, i have this error on Ratchet server. Please help! :(
PHP Fatal error: Uncaught Error: Class 'GuzzleHttp\Psr7\Rfc7230' not found in C:\xampp\htdocs\video-call-app\ws\vendor\guzzlehttp\psr7\src\functions.php:792
Stack trace:
#0 C:\xampp\htdocs\video-call-app\ws\vendor\guzzlehttp\psr7\src\functions.php(469): GuzzleHttp\Psr7\_parse_message('GET /ws/comm HT...')
#1 C:\xampp\htdocs\video-call-app\ws\vendor\cboden\ratchet\src\Ratchet\Http\HttpRequestParser.php(73): GuzzleHttp\Psr7\parse_request('GET /ws/comm HT...')
#2 C:\xampp\htdocs\video-call-app\ws\vendor\cboden\ratchet\src\Ratchet\Http\HttpRequestParser.php(40): Ratchet\Http\HttpRequestParser->parse('GET /ws/comm HT...')
#3 C:\xampp\htdocs\video-call-app\ws\vendor\cboden\ratchet\src\Ratchet\Http\HttpServer.php(42): Ratchet\Http\HttpRequestParser->onMessage(Object(Ratchet\Server\IoConnection), 'GET /ws/comm HT...')
#4 C:\xampp\htdocs\video-call-app\ws\vendor\cboden\ratchet\src\Ratchet\Server\IoServer.php(113): Ratchet\Http\HttpServer->onMessage(Object(Ratchet\Server\IoConnection), 'GET /ws/comm HT...')
#5 C:\xampp\htdocs\video-cal in C:\xampp\htdocs\video-call-app\ws\vendor\guzzlehttp\psr7\src\functions.php on line 792
Fatal error: Uncaught Error: Class 'GuzzleHttp\Psr7\Rfc7230' not found in C:\xampp\htdocs\video-call-app\ws\vendor\guzzlehttp\psr7\src\functions.php:792
Stack trace:
#0 C:\xampp\htdocs\video-call-app\ws\vendor\guzzlehttp\psr7\src\functions.php(469): GuzzleHttp\Psr7\_parse_message('GET /ws/comm HT...')
#1 C:\xampp\htdocs\video-call-app\ws\vendor\cboden\ratchet\src\Ratchet\Http\HttpRequestParser.php(73): GuzzleHttp\Psr7\parse_request('GET /ws/comm HT...')
#2 C:\xampp\htdocs\video-call-app\ws\vendor\cboden\ratchet\src\Ratchet\Http\HttpRequestParser.php(40): Ratchet\Http\HttpRequestParser->parse('GET /ws/comm HT...')
#3 C:\xampp\htdocs\video-call-app\ws\vendor\cboden\ratchet\src\Ratchet\Http\HttpServer.php(42): Ratchet\Http\HttpRequestParser->onMessage(Object(Ratchet\Server\IoConnection), 'GET /ws/comm HT...')
#4 C:\xampp\htdocs\video-call-app\ws\vendor\cboden\ratchet\src\Ratchet\Server\IoServer.php(113): Ratchet\Http\HttpServer->onMessage(Object(Ratchet\Server\IoConnection), 'GET /ws/comm HT...')
#5 C:\xampp\htdocs\video-cal in C:\xampp\htdocs\video-call-app\ws\vendor\guzzlehttp\psr7\src\functions.php on line 792
hi, amir i have attached the code file because after following your step it still show error in live server,so i've attached all the file please check and help me.
my code for enable mod proxy and mod_tunnel is
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
ProxyPass /wss2/ ws://192.232.212.25:8080/
well first of all i really appriciate the work. awesome i'm really getting intrest in rachet and webrtc from a while...
so here is my issue the code works fine with chat and all on wamp localhost but i put my wamp online and can access it over my android device over wifi ... using my servers IP 192.168.0.13/video-call-app the page opens and join same room over two phone on same wifi but nothing seems to be happing not even the toast that say connected or not connected to server(As it show on localhost) ... and nothing happens it says offline.
can you help me run this over LAN(WAMP)
Hello,
First of all thanks for this amazing code, i really loved it.
I am having an issue, when a user calls other user for the first time after page refresh, then the call is not connected and it gives error in console "Uncaught (in promise) DOMException: Failed to execute 'createAnswer' on 'RTCPeerConnection': PeerConnection cannot create an answer in a state other than have-remote-offer or have-local-pranswer." Now when it again calls the call works perfectly fine.
Then is the reciver refresh the page, and caller calls again then again have the same issue for the first time, and on second call it again works fine.
Please help me.
Its something with this code in comm.js
`myPC.createAnswer().then(description).catch(function(e){
console.log("Error creating answer", e);
showSnackBar("Call connection failed", 15000);
});`
I'm getting an empty response in the server.php file present in root directory of the app.
Nowhere is it mentioned that what we should do with that file. The line 30 just says:
CURLOPT_URL => "https://global.xirsys.net/_turn/YOUR-CHANNEL-NAME",//Replace 'YOUR-CHANNEL-NAME' with the name of your xirsys channel
Where do I get this channel name? And why isn't this important step mentioned explicitly in the Readme?
Hi
I have done this
wsChat = new WebSocket("ws:192.168.1.66:443/videocall/comm");
$allowed_origins = ['192.168.1.66', '443', '192.168.1.66', '192.168.1.66'];
// Run the server application through the WebSocket protocol on port 8080
$app = new Ratchet\App('192.168.1.66', 443, '0.0.0.0');//App(hostname, port, 'whoCanConnectIP', '')
still I am getting error message "Unable to connect to the chat server! Kindly refresh"
Hello, thanks for making this project available, i read the section on what to do if you hosting it online, it works fine on my localhost but when i tried it online not so much,
comm.js:27 WebSocket connection to 'wss://btest.docroa.com:8080/comm' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT
that is the error, thanks
Hi,
I have just got your code and tried on my local.The server has been connected .I am testing on my local.One in chrome and other in firefox .Both point to the same room. But the client and remote browser.If i tried to start video call from one browser (client ) and i expected to recieve ring on the other browser (remote). But the ring starts just on browser and doesn't even rings the other browser and full options (e.g Recieve call,doesntshows the online status etc). All i am getting "Connected" message in the beginning. The screen is completely dark. and not connecting..
Could you please advise?
See attached screen shot.Thanks
i have setup the application in localhost when i open chat room it says unable to connevt to server how should i resolve it
Hello Amir,
First of all, I'd like to say thank you for your great work!
There is an issue for me, it consists in:
I've deployed application to the server. I use ssl and I've configured proxy for that reason.
So my app uses that way to run ratchet:
`// Run the server application through the WebSocket protocol on port 8080
$app = new Ratchet\App('localhost', 8080, '0.0.0.0');
//create socket routes
//route(uri, classInstance, arrOfAllowedOrigins)
$app->route('/comm', new Comm, $allowed_origins);
//run websocket
$app->run();`
I've include domain name of my app in $allowed_origins.
and that way to connect to the web socket server side(Ratchet)
const wsChat = new WebSocket("wss://domain_name/wss2/comm");
domain_name is subdomain.
part in vhost configuration that related to proxy looks like
ProxyPass /wss2/ ws://localhost:8080/
Everything works well when I call from the same network. For example when I connected to the app by mobile and laptop from another side through the same wifi connection.
Problems start when I connected to app from different networks. For example by mobile device that uses mobile network in my country and from another side by laptop that uses another connection.
Connection is established. I can even make a call and accept from another side. But nothing happen, nothing is heard or seen, sometimes even another side doesn't informed that I've accepted a call(call continues). It looks like some messages of socket are blocked or something like that, but I can't figure out in which direction to move on.
Please let me know if you have any ideas.
Many Thanks
Roman
Hello Amir,
When I run server.php it tells me that class amir\Comm is not found even though it exists.. Any idea how to fix it ?
For run this online on ubuntu server, i can setup same create-ratchet-as-a-service-with-daemon.txt?
this is a same rules ubuntu?
Unable to connect to the chat server! Kindly refresh to acess demo
I tried the app to use its chat feature. When I enter localhost/video-chat-app and press 'Create Room' and 'Enter Room', and I am redirected to a new tab. The problem is that the chat is offline and the following message is displayed "Unable to connect to the chat server! Kindly refresh". When I copy and paste the URL in another tab or even check it on a different computer (e.g http://172.30.2.33/video-call-app/comm.html?room=s79md5385ef) I do not see messages in other window as the status is offline.
I have also made the IP address adjustments as per the Wiki but still I am unable to get it working either in localhost or on LAN.
Here is the error shown in the console:
WebSocket connection to 'ws://172.30.2.33:8080/comm' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED WrappedWebSocket @ blob:http://172.30.2.33/de2a32bd-f36d-49df-a4bf-b0b87fe8fa30:164
Thanks.
Hi Amir,
Thankyou for the code, i am working on your code, everything is working on Google Chrome but when I am trying on Firebox it's not working.
Its showing remote is offline status.
And when i am calling from Google Chrome to Mozilla Firefox , everything is Okay with Google Chrome side but on Firefox it showing the error "Unable to use your media sources"
i am running on localhost
I deployed this app on address https://phpvideochat.lupahosting.com.br/ and tried to Connect over 2 different mobile phones and video didn't show up.
Any ideas?
Hello how could I make the timer work?
Hi,
I followed all the instructions in the README.
The Ratchet server is running properly.
I am using xampp in Windows 10.
After entering the chat room I am getting the following error in console:
Firefox can’t establish a connection to the server at ws://192.168.1.107:8080/comm.
The remote is in offline status. Any help in this regard is appreciated. Thank you.
Hi i have setup the app as per your instructions. Below is what I am doing.
Could you please suggest what needs to be checked? Thanks in advance.
Imp Note: Earlier, I had written my own WebRTC code (from Mozilla) and it shows the camera capture without any issues. This is just an FYI to rule out any issues with WebRTC not working on my machine :-)
Is it necessary to use https://global.xirsys.net/_turn/ or can we create our own TURN STUN service?
Could you please help me? I try to connect this video app with IP address (localhost IP: 192.168.1.229) it could not work even on same system . but it works fine when i am using localhost in place of IP. i follow your README.md file and change all required as you suggested. please find below my changes in code:
1: change in server.php file
//set an array of origins allowed to connect to this server
$allowed_origins = ['localhost', '127.0.0.1','192.168.1.229'];
// Run the server application through the WebSocket protocol on port 8080
$app = new Ratchet\App('192.168.1.229', 9300, '0.0.0.0');//App(hostname, port, 'whoCanConnectIP', '')
2: Change in comm.js file
const wsChat = new WebSocket("ws://192.1.168.229:9300/comm");
Even i change IP with 127.0.0.1 it not works. Please suggest how it works
when i change host localhost/ to my ip_address(192.168.1.10)/
i got error :
Uncaught TypeError: Cannot read property 'version' of undefined
at adapter.js:29
at Object.1../chrome/chrome_shim (adapter.js:84)
at s (adapter.js:1)
at e (adapter.js:1)
at adapter.js:1
at adapter.js:1
at adapter.js:1
I access the cpanel of godaddy through ssh and run the server.php and even tried a cron job but not connecting to web socket .
I have my own chat sistem based on "My friends" and i have a list with online friends and i want when i click on a friend conversation to add the call functions but i don't know how to manage'it to have'it work. Can u help me pls? the conversation is with me (a) and user b (daniel) for example, and i want the room "?room=Daniel "to be created when i click user b and all the call functions to work. (The code is written in PHP + Jquery)
Could you please help me? I try to change my IP address in server.php file but I still could not run php server.php from my cli. Thanks in advance.
P/s: I am using XAMPP to run this.
As follow up of Issue #33 , I deleted the vendor directory and did composer install.
I run the server: php server.php
In the browser I open 127.0.0.1:8080/ and only a white screen.
As the readme says http://localhost/video-call-app/ doesn't work
There is a index.html with a create room button so I suppose this index.html is supposed to be called
Kindly verify the steps-
Please tell what changes need to be done and what steps to be followed on both sides.
I read your readme file but we are not able to get connected.
adapter.js:181 Uncaught TypeError: Failed to construct 'RTCPeerConnection': cannot convert to dictionary.
at new window.RTCPeerConnection (adapter.js:181)
at startCall (comm.js:647)
at HTMLButtonElement.answerCall (comm.js:608)
I got an error in local after connecting server. Not able to answer the call. Please able to solve this answer.
iOS Safari Not Connecting to Chat Server.
All other Browsers in Desktop, (MAC, Windows, Linux) Works Perfect
Hello. I am trying to contact amirsanni about the Multi User Video Chat. I would like to have it installed on as soon as possible. I can be contacted at [email protected].
Hey Amir,
I'm trying to run server.php but get a parse error. I don't know how to run the script on CLI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.