Conversation

This demo exposes a video conference sample with the possibility to select streams you want to publish or subscribe. You are also able to choose the type of stream you want to use , audio only, video only or audio & video.

Connect to the conference

Check our tutorial on conversation to have details about the conversation bases.

Publish your stream

When you publish your stream, use the publishOptions parameters to select media type you want to publish. Set audioOnly / videoOnly boolean to true or false depending of your needs.

        var publishOptions = {
            audioOnly : audioOnly,
            videoOnly : videoOnly
        }
        connectedConversation.publish(localStream, publishOptions)
            .then(function(stream) {
                publishedStream = stream;
                console.log("publish success:" + stream);
                [...]
            }).catch(function (err) {
                console.error('Conversation publish error', err);
            });
    

Subscribe to available streams

When you subscribe to streams, use the subscribeOptions parameters to select media type you want to subscribe. Set audioOnly / videoOnly boolean to true or false depending of your needs.

        var subscribeOptions = {
            audioOnly : mediaType === 'AUDIOONLY' ? true : false,
            videoOnly : mediaType === 'VIDEOONLY' ? true : false
        }
        connectedConversation.subscribeToStream(streamId, subscribeOptions)
            .then(function (stream) {
                console.log('subscribeToStream success');
            }).catch(function (err) {
                console.error('subscribeToStream error', err);
            });
    

Live Demo