Comments (2)
Hello,
Thank you for your interest in my project. The easiest way to add text chat
imo would be to use the socket.io channel to send messages. It already
support a chat room functionality. As you can see in the code, I've
implemented 2 kind of message, "id" and "message" (which could be confusing
in your case, I should probably rename it to "signal" or something like
that). Just add a third kind of message (like "chat"). That way, I don't
think it would be too much work to add this functionality.
On Mon, May 4, 2015 at 10:18 AM, dwsrumwq7cyey7qv [email protected]
wrote:
Hello,
I am thankful for the project and I am especially interested in the
combination of the web und android client. The video communication works
wonderful, but I am searching for a way to extend the project for a chat
functionality.
As far as I understood, the node.js server creates a stream for each
participant. Is it possible to use this stream to also pass on textual
data? Or should there be an additional stream, such that there are two
streams - one for audio/ video and text? How should this functionality be
implemented on android?
Thank you in advice!—
Reply to this email directly or view it on GitHub
#13.
from projectrtc.
Just as an addon, you can also use WebRTC DataChannel. This way the messages are not sent over the node js server. Example code, for WebRtcClient.java, for the AndroidRTC. And in the Web client should implement the onDataChannel.
private class Peer implements SdpObserver, PeerConnection.Observer {
private PeerConnection pc;
private DataChannel dc;
...
private class DcObserver implements DataChannel.Observer {
@Override
public void onMessage(DataChannel.Buffer buffer) {
// as an example write a response back
String response = "Response message";
ByteBuffer send = ByteBuffer.wrap(response.getBytes());
dc.send(new DataChannel.Buffer(send, false));
}
@Override
public void onStateChange(){
}
}
public Peer(String id, int endPoint) {
Log.d(TAG,"new Peer: "+id + " " + endPoint);
this.pc = factory.createPeerConnection(iceServers, pcConstraints, this);
this.id = id;
this.endPoint = endPoint;
pc.addStream(localMS); //, new MediaConstraints()
dc = pc.createDataChannel("sendDataChannel", new DataChannel.Init());
DcObserver dcObserver = new DcObserver();
dc.registerObserver(dcObserver);
mListener.onStatusChanged("CONNECTING");
}
}
I just wrote it and it works together with a web page that is implementing the onDataChannel. But for some reason I could not get it working when the web client calls createDataChannel. The onDataChannel is never called in Android. In any case, I am sure it is something that i have missed somewhere. Just thought it might help someone.
from projectrtc.
Related Issues (20)
- am i able to geneate static files.
- Video Stream to be passed directly
- How to set client.id by myself? HOT 2
- save to file
- how to change port? HOT 1
- the end of the call service is too late, i m waiting abouts 5-15 seconds, how do i fix ?
- Stream rotates and changes it's size
- How to connect the server? HOT 2
- Browser does not appear to be WebRTC-capable HOT 5
- Https wont work
- npm start error
- DOMException when testing
- upm install error
- tried deploying on local as well as on Azure using node js
- TypeError: "getUserMedia is not a function" HOT 1
- Is Creator of ProjectRTC is no more / dead ? (pchab) HOT 1
- Does this support Multi Streaming?
- Remote Streams black HOT 3
- no desktop client?
- Issue with NodeJS v.16.17.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from projectrtc.