GithubHelp home page GithubHelp logo

amirsanni / video-call-app Goto Github PK

View Code? Open in Web Editor NEW
224.0 20.0 142.0 1.42 MB

A text, audio and video chat application built with webRTC and Ratchet (PHP WebSocket)

PHP 7.02% CSS 4.40% JavaScript 80.93% HTML 6.24% Shell 1.42%
ratchet webrtc javascript video-call php

video-call-app's People

Contributors

amirsanni avatar dependabot[bot] avatar gildonei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

video-call-app's Issues

i tried to run it on my local server

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

PHP Fatal error

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.

Connection problem on production and localhost

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.

Chat Room not coming up

error

Hi amirsanni
I downloaded your code and copied it in my htdocs folder made the required changes-

  1. In server.php fille
    $allowed_origins = ['localhost', '127.0.0.1','192.168.100.5'];
    $app = new Ratchet\App('192.168.100.5', 8080, '0.0.0.0');
    2)In comm.php file
    const wsChat = new WebSocket("ws://192.168.100.5:8080/comm");

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.

Lack of response?

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)

Not working on local


Notice: Undefined property: stdClass::$v in C:\xampp\htdocs\Video-Call-App-master\Server.php on line 15

Notice: Trying to get property 'iceServers' of non-object in C:\xampp\htdocs\Video-Call-App-master\Server.php on line 15
null****

image

I don't get it running

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.

PHP ERROR, SERVER CONNECT

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

Not run on live server

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/

comm
error
server

How to make it work on Wamp 3.0.6 over LAN

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)

Error on first time call

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);
        });`

connection issue

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"

connect to websocket online!!!

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

Call Recieve Options not visible

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

amirsanni
@amirsanni

sever not cnnected

i have setup the application in localhost when i open chat room it says unable to connevt to server how should i resolve it

Can't make a call between chat rooms that opened in different networks.

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

Class not found

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 ?

Install service on Ubuntu

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?

Chat is offline, even in localhost tabs

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.

Not working on Firefox

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

Firefox can’t establish a connection to the server at ws://192.168.1.107:8080/comm.

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.

rtc

The remote is in offline status. Any help in this regard is appreciated. Thank you.

camera capture not displaying at all on both ends.

Hi i have setup the app as per your instructions. Below is what I am doing.

  1. I have setup my own PHP Ratchet websocket server.
  2. I use your app to connect to that websocket server on port 8080. Shows connected.
  3. I am able to connect to the room from 2 devices (my laptop and from my mobile). I am able to send messages over the chat from device 1 and the same is received by 2nd device. Also vice-versa.
  4. However, when i make a camera call, and accept it on other device. No camera shows on both ends.
  5. I am seeing that the H/W camera light on laptop is active which means it is capturing the stream but isn't displaying on the myvid html element. Also peer video too not visible.

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 :-)

Not able to connect to server with IP address even on same same system

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

Cannot read property 'version' of undefine

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

How can i implement in my own friends chat sistem?

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)

White screen, not able to create room

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

Verify the steps

Kindly verify the steps-

  1. Make changes in comm.js and server.php files by replacing with our ip address.
  2. Run server.php file from cli.
  3. Browse ourserver/Video-Call-App.

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.

RTCpeerConnection

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.

Multi User Video Chat

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].

How to connect locally

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.