Amir Sanni 6 years ago
parent
commit
a37285e5fb
  1. 9
      README.md
  2. 6
      js/comm.js

9
README.md

@ -18,9 +18,9 @@ To test this app on your local server:
- Works best on Chrome, Firefox and the latest versions of Opera desktop browser. - Works best on Chrome, Firefox and the latest versions of Opera desktop browser.
#Note ## Note
To host this online, you'll need to set up a few things: To host this online, you'll need to set up a few things:
- Create Ratchet as a service so it can run persistently on your server. Check the file *ratchet_as_a_service.txt* for the guide on how to do this on CentOS7 - Create Ratchet as a service so it can run persistently on your server. Check the file *create-ratchet-as-a-service-with-daemon.txt* for the guide on how to do this on CentOS7
- If on SSL, Ratchet won't work unless you make some changes on your server. - If on SSL, Ratchet won't work unless you make some changes on your server.
- Enable mod_proxy.so - Enable mod_proxy.so
- Enable mod_proxy_wstunnel.so - Enable mod_proxy_wstunnel.so
@ -43,3 +43,8 @@ To host this online, you'll need to set up a few things:
- Once you put the Proxypass directive there, restart your server and there you go. - Once you put the Proxypass directive there, restart your server and there you go.
This [answer on Stack Overflow](https://stackoverflow.com/a/28393526/4522890) should be helpful. This [answer on Stack Overflow](https://stackoverflow.com/a/28393526/4522890) should be helpful.
# Demo
You can test at http://1410inc.xyz/video-call-app. Please test on Firefox as Chrome will not grant access to media devices if not HTTPS.

6
js/comm.js

@ -578,8 +578,7 @@ function startCall(isCaller){
//When remote stream becomes available //When remote stream becomes available
myPC.ontrack = function(e){ myPC.ontrack = function(e){
document.getElementById("peerVid").src = window.URL.createObjectURL(e.streams[0]); document.getElementById("peerVid").srcObject = e.streams[0];
// document.getElementById("peerVid").src = window.HTMLMediaElement.srcObject(e.streams[0]);
}; };
@ -644,8 +643,7 @@ function setLocalMedia(streamConstraints, isCaller){
navigator.mediaDevices.getUserMedia( navigator.mediaDevices.getUserMedia(
streamConstraints streamConstraints
).then(function(myStream){ ).then(function(myStream){
document.getElementById("myVid").src = window.URL.createObjectURL(myStream); document.getElementById("myVid").srcObject = myStream;
// document.getElementById("peerVid").src = window.HTMLMediaElement.srcObject(e.streams[0]);
myPC.addStream(myStream);//add my stream to RTCPeerConnection myPC.addStream(myStream);//add my stream to RTCPeerConnection

Loading…
Cancel
Save