muaz-khan / webrtc-experiment Goto Github PK
View Code? Open in Web Editor NEWWebRTC, WebRTC and WebRTC. Everything here is all about WebRTC!!
Home Page: https://www.webrtc-experiment.com/
License: MIT License
WebRTC, WebRTC and WebRTC. Everything here is all about WebRTC!!
Home Page: https://www.webrtc-experiment.com/
License: MIT License
One of the current problems I'm experiencing with RTCMultiConnection-v1.2.js with the socketio-over-nodejs server is the lack of a proper way to establish a session. I'm currently using the hack that waits 5 seconds to see if it gets a session invite, otherwise it creates a new channel, but it's pretty unreliable, especially with a slow connection.
I feel like there should be a way to ask the server - "does this room exist?" - like you do with Firebase. Otherwise the two people who want to chat have to go in one at a time, which is not always practical. And a 5 second wait is quite long...especially when testing over and over :)
Thank you a lot for your help!
I tried the latest version "RTCMultiConnection_1.2" yesterday with the given demo "user-ejection" using my own firebase site.
I found that there is data remained in my firebase after connection even though the web pages are closed (The remained data is user id varying from 0~9999 giving below).
And the "audio-conference" mode in the earlier version "RTCMultiConnection_1.1" doesn't have this problem.
I read the code of "RTCMultiConnection_1.2" and find that the method "socket.onDisconnect().remove()" isn't attached to every firebase socket but only the initiator's socket.
self.open = function (_channel, extra) {
......
if(self.socket) self.socket.onDisconnect().remove();
};
I think that the above function means that only the initiator's quit will delete it's data in firebase. It causes the data remaining problem. But if I attach "onDisconnect().remove()" method to every firebase connection in the function "openSignalingChannel", just as what the version 1.1 did, then any member's quit will remove the whole room data in firebase.
Would you please tell me whether I can fix this problem?
Sorry for my poor English.
i do not if i did it wrong.
if test this demo https://webrtc-experiment.appspot.com/RTCMultiConnection/video-conferencing/ with custom signaling.
the client code is
openSignalingChannel: function(config) {
URL = 'http://localhost:8888/';
channel = config.channel || this.channel || 'Default-Socket';
sender = Math.round(Math.random() * 60535) + 5000;
io.connect(URL).emit('new-channel', {
channel: channel,
sender : sender
});
socket = io.connect(URL + channel);
socket.channel = channel;
socket.on('connect', function () {
if (config.callback) config.callback(socket);
});
socket.send = function (message) {
socket.emit('message', {
sender: sender,
data : message
});
};
socket.on('message', config.onmessage);
}
the server side code i use is from https://github.com/muaz-khan/WebRTC-Experiment/blob/master/socketio-over-nodejs/webrtc-signaling/signaler.js
i open two tab in my browser, but it can not signaling.
Will there be the option like in DataChannel, where you can do connection.channels[userId].send(...) to send a direct message?
1 -> started a new session
2 -> gave the same URL in the another system.
only can view the self video , but not the peer video. Text chat is also not working.
Hi, muaz
Is there a way to record the video and audio together and output as one file?
Thanks.
Chrome (26, gnu/linux - kubuntu) did not ask me to allow video
and I do not see any video (of myself)
Hi Mauz
Have been playing with your experiments - they are great and very interesting. Please excuse me but I am not a java script person at all - my limitation is a small (very) bit of jQuery - php etc. I have no problem with so if you have already answered this question I apologise.
So I run the RecordRTC "file/s" on my server I can record video and I can stop, I can then view that video (in terms of your demo page), but how do I/can I send/save the file which I assume is a temp file(?) to the server.
The demo page shows this:
/* stop recording video and save recorded file to disk */
recorder.stopVideo(function(recordedFileURL) {
window.open(recordedFileURL);
});
but is that actually saving the file because my basic understanding is that just opens another window.
Lets say I run the demo on page "record.php" and I have a folder "recordings" how do I get the file into recordings and save it?
Cheers
So here's the scenario. I'm hoping you could help shed some light on what's happening.
This seems to work.
This doesn't work.
Uncaught Multi-capturing of screen is not allowed. Capturing process is denied. Are you enabled flag: "Enable screen capture support in getUserMedia"?
Right now, I'm just trying to test this with two windows in Google Chrome, and I'm not sure if that's contributing to the issue. Maybe I need two separate machines to really work on this scenario.
Thoughts?
Hi Muaz,
I am trying to run your video-conferencing example and replace Firebase with my local node.js server. As your example makes use of the Firebase API I am wondering whether you have already a node.js wrapper around socket.io that will run with the video-conferencing example?
I saw your other experiments with socket.io and node.js but that doesn't seem to provide a suitable implementation for the API.
Thanks in advance
Mumin
I had some questions regarding screen sharing in Chrome. On one of your demo pages, I found this limitation.
You requested audio-stream alongwith 'chromeMediaSource' – it is not permitted in a "single" getUserMedia request.
Some questions I had:
Finally, I just want to say that all of your work on WebRTC has been fantastic. Really great stuff.
First of all, congratulations on your amazing work! :-) I'd like to ask a couple of questions:
Hi!
So far this seems to be the best library/project/solution for a P2P chat, but DataChannel seems to be missing some crucial features:
1: It would be great, if there was no separate "create room", and "join room", but rather check if room exists, and if it does, join it, otherwise create it.
2: channel.onclose event does not seem to be working currently.
3: Maybe it's just me, but I can't see any way of following/identifying, who is in the room currently, and who has sent the message in a many-to-many connection.
PeerJS seems to be the only other functional solution, but they have a custom server for setting up communication, and it needs API key, and I have asked, and they are not willing to give Firebase support, so that's a no go.
I have tried to fix the above mentioned problems myself and than maybe do a push, but the task seems to be above my head. :(
Issue: unable to get remote stream in case when a “remote stream” is attached by calling “peer.addStream ( remoteStream )”
Yeah, it allows us overcome burden from a single peer. Burden will be shared.
Also, we can support a wide range of peer’s connectivity.
var MediaStream = window.webkitMediaStream || window.MediaStream;
firstPeer.onaddstream = function(remoteSteam) {
remoteStream = new MediaStream(remoteSteam.audioTracks, remoteSteam.videoTracks);
otherPeer.addStream(remoteStream); /* attaching remote stream */
};
We will get following benefits (in case of success):
A known bug in chromium: peer.onicecandidate not fires for 11th peer. You don’t need to worry about that bug!!
Pitfall: If peer number 1, 2, 5, 8 … tries to leave the room without informing other peers to play a host role.
If peer number 2 leaves the room, without informing master peer or peer number 5 to handling upcoming peers.
https://googledrive.com/host/0B6GWd_dUUTT8V1Fodm9WQldkb28/
Open 4 tabs....1st table should create room……..join room from other tabs.....see the behavior of the 4th tab.
please, have you a soluce?
onclose is not firing when other peer leaves the group
and can't connect to the same group on joining( no peer connection established)
Thank you a lot for your help!
I tried the version "RTCMultiConnection_1.2" in my own site. I find that the "many-to-many" audio conference runs very well in Ubuntu 12.04 system. But if I use Windows 8 system to visit the same site, it won't work most of the times.
After comparing these two systems, I think that the firewall of Windows 8 did something to prevent the flowing of our audio stream. Could this happen?
audio recording is not recording audio. i cannot hear anything from recorded file eg.audio.wav from your site. Please help
I noticed the Pluginfree-Screen-Sharing is using the services at firebaseio.com
Is that possible to self hosted it?
Which node.js file we could use to start the services?
Thanks,
Can we host whatever you hosted on "https://webrtc-experiment.firebaseio.com/" in our own server to get rid of the limitation. I am new to Git and novice in WebRTC. Please help!
Is there a clean way to close a RTCMultiConnection without reloading the whole page? Thanks.
What if I want to use my own WebSocket ?
I don't know how to modify the following code...
var socket = new WebSocket('ws://your-websocket-url/');
should I do something in my websocket-url?
Hi!
RecordRTC Video recording does not record sound. is there a special setting or is it a bug with video recording?
Although the recording ends in terms of creating a file, the tab still flashes red as if it is still recording. Using Version 28.0.1496.0 dev on Mac.
hi, my ideas
function startBroadcasting() {
defaultSocket.send({
sessionid: self.sessionid,
userid: self.id,
session: config.session,
direction: config.direction
});
if (config.direction === Direction.OneToOne) {
if (!window.isFirstConnectionOpened)
setTimeout(startBroadcasting, 3000);
} else
setTimeout(startBroadcasting, 3000);
}
Change the default time (3000) by a optional time e.g.
webRTC = new RTCMultiConnection();
webRTC.broadcast = 1000 * 60;
can add any datas to send with the broadcast (by a onXXXXX(data) function ?? ) and intercept the receive by a onXXXXX(data).
if we use a private openSignalingChannel
with the RTCMultiConnection library, we must can specify a global name to send the broadcast ( startBroadcasting()
) and a session name .
eg
connection.openSignalingChannel = function (config) {
var socket = io.connect('http://your-site:8888');
socket.channel = config.channel || this.channel || 'default-channel';
socket.on('message', config.onmessage);
var bdc = config.broadcastchannel || this.broadcastchannel || 'default-broadcast';
socket.on(bdc, config.onboradcastmessage);
socket.send = function (data) {
socket.emit('message', data);
};
socket.sendbroadcast = function (data) {
socket.emit(bdc, data);
};
if (config.onopen) setTimeout(config.onopen, 1);
return socket;
}
If I understand correctly, for somebody to participate in a conference, they must use video stream as well. Is there a way to allow people to join the conference without having to use their camera?
Eg. I would like to invite a friend to a conference, however it would be up to him to stream from this end. He should basically see and chat with others without him having to share his video stream.
I tried "Deny" button when it prompt me to share webcam, the app did not allow me join the room/session.
https://googledrive.com/host/0B6GWd_dUUTT8RzVSRVU2MlIxcm8/RecordRTC/
Using Chrome Version 25.0.1364.97 m
I can save video w/ data.
Audio is blank (but the right duration).
Unlike your other excellent demos, this one does noting when I click the Share button.
Regards,
I can't get the voice data.
I try this demo on chrome 27.0 dev,there is no Web Audio Input in about:flags,the video record works well,but the wav file is silent,the length of the file is right. After debug,I found that in the onaudioprocess evevt,the input buffer array's data were 0.Does this demo works well on winXP?
Is it possible to reduce the load on the processor in the video? What affects the load? Can be a great camera resolution? If more than three parties becomes very slow.
I have seen that every time you start a call/session, RTCMulti asks user the approval again.
Inside the function getUserMedia(), can't we save the current local stream, and reuse it every time it's asked?
Example:
var userMediaInited = false;
var userMediaStream = null;
function getUserMedia(options) {
var n = navigator,
media;
resourcesNeeded = (options.constraints || {
audio: true,
video: video_constraints
};
if(userMediaInited && userMediaStream
&& userMediaInited.audio >= resourcesNeeded.audio
&& userMediaInited.video >= resourcesNeeded.video)
streaming(userMediaStream)
else{
n.getMedia = n.webkitGetUserMedia || n.mozGetUserMedia;
n.getMedia(resourcesNeeded, streaming, options.onerror || function (e) {
console.error(e);
});
}
function streaming(stream) {
video = options.video;
if (video) {
video[moz ? 'mozSrcObject' : 'src'] = moz ? stream : window.webkitURL.createObjectURL(stream);
video.play();
}
options.onsuccess(stream);
userMediaStream = media = stream;
}
return media;
}
I'm having a problem with one client when somebody offers to the client RTCPeerConnection connection finishes just fine, but when client send offers to other clients connection is never established. The client is located in US, I've tried with different clients from Europe and everything works just fine.
I tried running the code downloaded from the repo first, didn't work. Then I tried copying the index.html RecordRTC.js and audio-record.js from the live online example - didn't work either. I'm having hard time troubles shooting the issue because I get no errors.
Important to note - the live example work great.
I'm thinking to add new experiment for remote files collaboration and access. WebRTC data channels can be used for synchronization. Is this experiment will matter? ....or?
Any suggestions for features to be added in that remote file accessing
experiment?
It would be great if we could use this software to broadcast webrtc to an icecast2 server.
There's a thread on the icecast2-dev list on this topic here:
http://lists.xiph.org/pipermail/icecast-dev/2013-May/thread.html#2168
So I have two laptops at home both using the latest chrome at home. I tried your demo to simulate a one-to-one connection using video+audio but I had difficulties getting them to initialize the remote connections. Is this an issue on your end or does this plugin prevent the same connection from happening that shares the same router?
Yesterday, I started play with this library with Node.js. I am not sure if this issue is on my browser or code.
When somebody leaves or closes the browser, the video stream of the person does not come off the remote video list. It would be nice if somehow onbeforeunload event it notifies everybody the user has left and removes the video stream from the list.
On those systems connected over LAN, RTP media streams flows finely but SCTP or RTP-data streams not.
RTCDataChannel is unable to establish connection over LAN.
Maybe this is a known bug in chromium or Gecko.
For example, following experiments works fine on those LAN oriented systems:
But following experiments fails:
Remember, personally I've not tested RTCDataChannel specific experiments on LAN.
Hii Muaz, can you add sample Socket.io Server in this repository ? i try [1] with my python socket.io server but its not work.
My python Code
https://gist.github.com/dodolboks/5284171
[1] https://googledrive.com/host/0B6GWd_dUUTT8RzVSRVU2MlIxcm8/webrtc-broadcasting/
Thanks
I use your latest bandwidth demo, and it works fine with one-to-one conference. But if i trying to connect more than one videos, i get infinity ["setTimeout(onRemoteStreamStartsFlowing, 300)"] message in chrome console and new peers doesn't connect to session. What's the problem? Is it bug of my browser, web-camera, etc. or RTCMultiConnection library?
PS sorry for my bad english
It would be nice if we could pass userid in methods open and connect.
For example: channel.open('default_channel','lodkijd');
where lodkijd would be a userid. If the second parameter is missing then it can be generated as it was before(random string)
It is able to create room in conference without main (initiator) user ?
Can intiator leave room and other clients would be stay in there ?
Thanks.
Sorry for english.
Test this WebRTC Chrome to Firefox video conferencing demo. It works fine if Chrome Beta is OFFERER and Firefox Nightly is ANSWERER.
https://googledrive.com/host/0B6GWd_dUUTT8dW5ycGVPT0V1bTg/chrome-to-firefox.html
It fails if Firefox Nightly creates Offer-SDP and chrome beta tries to create Answer SDP.
Though, it gets remote stream finely in both cases. But the blank stream in 2nd case!
Here is the source code:
https://github.com/muaz-khan/WebRTC-Experiment/tree/master/chrome-to-firefox
I think the original issue comes in this line:
just have a little test
Hi Muaz,
I have successfully managed to run your socketio-over-nodejs experiment on my local machine (Firefox to Chrome) and between different notebooks within our corporate network.
The second try was to run the signaling server on an EC2 instance (AWS) and connect again two notebooks from within the same corporate network (worked as well). Then I tried to connect two notebooks being in totally different networks. Signaling still via AWS worked but the audio/video stream was not established between the two endpoints (NAT problem I guess).
So I tried to setup an own turn server on AWS using https://code.google.com/p/rfc5766-turn-server. Added user, pw and opened TCP and UDP STUN port 3478. Finally, added own server to RTCPeerConnection (v1.5) like this:
var iceServers = {
iceServers: [
{
"url":"turn:[email protected]", "credential":"userXYZsecret"
},
{
url: !moz ? 'stun:stun.l.google.com:19302' : 'stun:23.21.150.121'
}
]
};
With this I expected that my turn server would be connected, but it isn't. Within our corporate network it is still working but I see no access to this turn server. Firefox console tells me:
In RTCConfiguration passed to RTCPeerConnection constructor: Credentials not yet implemented. Omitting "turn:userXYZ@54....."
That obviously means RTCPeerConnection V1.5 does not support this yet, right?
I have seen that you have released a version 1.6 already, although the version within this experiment is still v1.5. Simple replacement didn't work (even the local communication wasn't working after this change. Any idea what goes wrong here?
BTW, have you ever tried to use a video stream (e.g. provided by VLC or so) as and additional video source for your experiments? I have a demand for transmitting this in parallel to the local webcam (i.e. audio/video conf plus the extra video stream) and no idea if thats possible and where to start.
Thanks in advance!
hi, how to know if i use RTCMultiConnection() :
I cannot seem to get Socket.IO & RTCMultiConnection-1.3 playing together, maybe for the same reasons that caused #54 to be opened. You seem to know that these don't work together and suggest an upgrade to 1.4 (#54 (comment)), but at the moment this is not an option. Do you have any clues on how to make 1.3 work with Socket.IO?
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.