These are chat archives for andyet/SimpleWebRTC

27th
Apr 2017
Seyedamirhossein Hesamian
@amir734jj
Apr 27 2017 18:30
@StudioInteractive I'm sill having trouble. I don't understand, how other party can receive the message data that was sent. How other party can get the message and show the message.
$(document).ready(function() {
    var webrtc = new SimpleWebRTC({
        // the id/element dom element that will hold "our" video
        localVideoEl: "localVideo",
        // the id/element dom element that will hold remote videos
        remoteVideosEl: "remoteVideos",
        // immediately ask for camera access
        autoRequestMedia: true
    });

    //we have to wait until it"s ready
    webrtc.on("readyToCall", function(video, peer) {
        // you can name it anything
        webrtc.joinRoom("amir734jj");
        webrtc.pauseVideo();
    });

    $("#send").click(function() {
        webrtc.sendDirectlyToAll("amir734jj", "message", $("#message").val());
        webrtc.sendToAll("message", $("#message").val());
        $("#message").val("");
    });
});
Assuming sendDirectlyToAll or sendToAll are working. How other party can receive the message?
Seyedamirhossein Hesamian
@amir734jj
Apr 27 2017 18:35
is it even possible to pass both audio and text message through one channel? If not can we join to multiple channels, one for audio, another for chat?
LuckyCyborg
@LuckyCyborg
Apr 27 2017 18:39
Look, with the SimpleWebRTC you can do two things: a video chat as its main target, or a group text chat. If you look to a (text) chat one-to-one you are stoned.

Heck, not every one wants/needs Video Chats!

What happened with the old good text Chat between two guys, with a presence channel to see each other on line?

Seyedamirhossein Hesamian
@amir734jj
Apr 27 2017 18:45
@LuckyCyborg I hate to say this but documentation for "SimpleWebRTC" are just useless and incomplete.
LuckyCyborg
@LuckyCyborg
Apr 27 2017 18:48
Look, in my opinion we should bear in mind that someone wanted a Video Chat. That's all and that's all it do.
Forget about presence channels, about text chats, about notification channels. Nothing. You can do with it a Video Chat one-to-one and nothing more.
Seyedamirhossein Hesamian
@amir734jj
Apr 27 2017 18:50
Yes. This library is great for video/audio chat, that's all.
notasgoodasyou
@notasgoodasyou
Apr 27 2017 23:59

@StudioInteractive so I managed to trigger the videoAdded to other peers by adding

// joins room when page loads (for those who don't want to cam up)
   webrtc.joinRoom('test');

// if a peer cams up, then rejoins room, triggering 'videoAdded' event and letting other peers know
    webrtc.on('readyToCall', function () {
    webrtc.joinRoom('test');
    });

so once the user broadcasts the localVideo, readyToCall will be triggered and re-join the user back into the room which will then push their video to other peers with "videoAdded" event. My problem now is that if new users join afterwards, it doesn't detect the video (which I find strange because before it would require a refresh to view the newly added streams). Fixed one problem and broke another, any suggestions?