Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

publishChannels #424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/sdk/conference/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,23 @@ export const ConferenceClient = function(config, signalingImpl) {
if (!(stream instanceof StreamModule.LocalStream)) {
return Promise.reject(new ConferenceError('Invalid stream.'));
}
if (publishChannels.has(stream.mediaStream.id)) {


let ch = publishChannels.get(stream.mediaStream.id);
if (ch && !ch._stopped) {
return Promise.reject(new ConferenceError(
'Cannot publish a published stream.'));
}
const channel = createPeerConnectionChannel();

publishChannels.set(stream.mediaStream.id, channel);

return channel.publish(stream, options, videoCodecs);
};

this.getChannel = function(streamId){
return publishChannels.get(streamId);
};

/**
* @function subscribe
Expand Down