Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove remote video stream when somebody leaves #39

Open
imomin opened this issue Jun 2, 2013 · 3 comments
Open

Remove remote video stream when somebody leaves #39

imomin opened this issue Jun 2, 2013 · 3 comments

Comments

@imomin
Copy link

imomin commented Jun 2, 2013

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.

muaz-khan added a commit that referenced this issue Jun 3, 2013
Channel presence in "socket.io over node.js" can be detected like this:

function testChannelPresence(channel) {
var socket = io.connect('/');

socket.on('presence', function (isChannelPresent) {
console.log('is channel present', isChannelPresent);
if (!isChannelPresent) playRoleOfSessionInitiator();
});

socket.emit('presence', channel);
}
testChannelPresence('default-channel');

Demo: http://webrtc-signaling.jit.su/RTCMultiConnection

Socket.io over Node.js source code:

https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs
@ajvpot
Copy link

ajvpot commented Jul 27, 2013

This is not fixed.

@muaz-khan
Copy link
Owner

Try this demo:

<script src="https://www.webrtc-experiment.com/RTCMultiConnection-v1.4.js"> </script>
<button id="init">Open New Connection</button><br />
<script>
    var connection = new RTCMultiConnection();

    connection.session = {
        audio: true,
        video: true
    };

    connection.onstream = function(e) {
        document.body.appendChild(e.mediaElement);
    };

    connection.onstreamended = function(e) {
        if (e.mediaElement.parentNode) e.mediaElement.parentNode.removeChild(e.mediaElement);
    };

    var session_unique_idetifier = 'Session Unique Identifier';

    connection.connect(session_unique_idetifier);

    document.getElementById('init').onclick = function() {
        this.disabled = true;
        connection.open(session_unique_idetifier);
    };
</script>

@ajvpot
Copy link

ajvpot commented Jul 27, 2013

That definately works. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants