muaz-khan / RTCMultiConnection-SignalR

SignalR project for RTCMultiConnection
https://github.com/muaz-khan/RTCMultiConnection
MIT License
21 stars 10 forks source link

Modify RTCMultiConnection.js #1

Open Jhordan92 opened 6 years ago

Jhordan92 commented 6 years ago

I'm trying to get more control over the events related to the connections of each user. I wan to keep track and update to each user a list of users connected, and to specify the Video tag id, I'm already adding to a list in the hub, each user connected, and I have a method in the hub that returns the list, but I'm trying to obtain the data when a user connects. So I tried accessing to the onStream event, but it doesn't seem to enter there.

`connection.onstream = function (e) {

        debugger
        var parentNode = connection.videosContainer;
        parentNode.insertBefore(e.mediaElement, parentNode.firstChild);
        var played = e.mediaElement.play();
        return "undefined" != typeof played ? void played["catch"](function () { }).then(function () {
            setTimeout(function () {
                e.mediaElement.play()
            }, 2e3)
        }) : void setTimeout(function () {
            e.mediaElement.play()
        }, 2e3)
    }`
muaz-khan commented 6 years ago

Did you solve it?