mirror of https://github.com/OpenVidu/openvidu.git
Connections can be created to send only audio, only video or both
parent
cc135f4d8b
commit
93d21bfc42
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -57,16 +57,20 @@ export class OpenVidu {
|
|||
if (this.checkSystemRequirements()) {
|
||||
if (cameraOptions != null) {
|
||||
let cameraOptionsAux = {
|
||||
audio: cameraOptions.audio != null ? cameraOptions.audio : true,
|
||||
video: cameraOptions.video != null ? cameraOptions.video : true,
|
||||
sendAudio: cameraOptions.audio != null ? cameraOptions.audio : true,
|
||||
sendVideo: cameraOptions.video != null ? cameraOptions.video : true,
|
||||
activeAudio: cameraOptions.activeAudio != null ? cameraOptions.activeAudio : true,
|
||||
activeVideo: cameraOptions.activeVideo != null ? cameraOptions.activeVideo : true,
|
||||
data: true,
|
||||
mediaConstraints: this.openVidu.generateMediaConstraints(cameraOptions.quality)
|
||||
mediaConstraints: this.openVidu.generateMediaConstraints(cameraOptions)
|
||||
};
|
||||
cameraOptions = cameraOptionsAux;
|
||||
} else {
|
||||
cameraOptions = {
|
||||
audio: true,
|
||||
video: true,
|
||||
sendAudio: true,
|
||||
sendVideo: true,
|
||||
activeAudio: true,
|
||||
activeVideo: true,
|
||||
data: true,
|
||||
mediaConstraints: {
|
||||
audio: true,
|
||||
|
|
|
@ -8,7 +8,8 @@ export interface ConnectionOptions {
|
|||
id: string;
|
||||
metadata: string;
|
||||
streams?: StreamOptions[];
|
||||
audioOnly: boolean;
|
||||
audioActive: boolean;
|
||||
videoActive: boolean;
|
||||
}
|
||||
|
||||
export class Connection {
|
||||
|
@ -74,13 +75,14 @@ export class Connection {
|
|||
let streamOpts = {
|
||||
id: streamOptions.id,
|
||||
connection: this,
|
||||
recvVideo: ( streamOptions.recvVideo == undefined ? true : streamOptions.recvVideo ),
|
||||
recvAudio: ( streamOptions.recvAudio == undefined ? true : streamOptions.recvAudio ),
|
||||
audio: streamOptions.audio,
|
||||
video: streamOptions.video,
|
||||
sendAudio: streamOptions.sendAudio,
|
||||
sendVideo: streamOptions.sendVideo,
|
||||
recvAudio: ( streamOptions.audioActive == undefined ? true : streamOptions.audioActive ),
|
||||
recvVideo: ( streamOptions.videoActive == undefined ? true : streamOptions.videoActive ),
|
||||
activeAudio: streamOptions.activeAudio,
|
||||
activeVideo: streamOptions.activeVideo,
|
||||
data: streamOptions.data,
|
||||
mediaConstraints: streamOptions.mediaConstraints,
|
||||
audioOnly: streamOptions.audioOnly,
|
||||
mediaConstraints: streamOptions.mediaConstraints
|
||||
}
|
||||
let stream = new Stream(this.openVidu, false, this.room, streamOpts );
|
||||
|
||||
|
|
|
@ -297,33 +297,22 @@ export class OpenViduInternal {
|
|||
}
|
||||
|
||||
options = options || {
|
||||
audio: true,
|
||||
video: true,
|
||||
sendAudio: true,
|
||||
sendVideo: true,
|
||||
activeAudio: true,
|
||||
activeVideo: true,
|
||||
data: true,
|
||||
mediaConstraints: {
|
||||
audio: true,
|
||||
video: { width: { ideal: 1280 } }
|
||||
}
|
||||
}
|
||||
|
||||
options.connection = this.session.getLocalParticipant();
|
||||
|
||||
this.camera = new Stream(this, true, this.session, options);
|
||||
return this.camera;
|
||||
};
|
||||
|
||||
/*joinSession(options: SessionOptions, callback: Callback<Session>) {
|
||||
|
||||
this.session.configure(options);
|
||||
|
||||
this.session.connect2();
|
||||
|
||||
this.session.addEventListener('room-connected', roomEvent => callback(undefined,this.session));
|
||||
|
||||
this.session.addEventListener('error-room', error => callback(error));
|
||||
|
||||
return this.session;
|
||||
};*/
|
||||
|
||||
//CHAT
|
||||
sendMessage(room, user, message) {
|
||||
this.sendRequest('sendMessage', {
|
||||
|
@ -362,33 +351,36 @@ export class OpenViduInternal {
|
|||
this.toggleLocalAudioTrack(false);
|
||||
}
|
||||
|
||||
generateMediaConstraints(quality: string) {
|
||||
generateMediaConstraints(cameraOptions: any) {
|
||||
let mediaConstraints = {
|
||||
audio: true,
|
||||
audio: cameraOptions.audio,
|
||||
video: {}
|
||||
}
|
||||
let w, h;
|
||||
switch (quality) {
|
||||
case 'LOW':
|
||||
w = 320;
|
||||
h = 240;
|
||||
break;
|
||||
case 'MEDIUM':
|
||||
w = 640;
|
||||
h = 480;
|
||||
break;
|
||||
case 'HIGH':
|
||||
w = 1280;
|
||||
h = 720;
|
||||
break;
|
||||
default:
|
||||
w = 640;
|
||||
h = 480;
|
||||
if (!cameraOptions.video) {
|
||||
mediaConstraints.video = false
|
||||
} else {
|
||||
let w, h;
|
||||
switch (cameraOptions.quality) {
|
||||
case 'LOW':
|
||||
w = 320;
|
||||
h = 240;
|
||||
break;
|
||||
case 'MEDIUM':
|
||||
w = 640;
|
||||
h = 480;
|
||||
break;
|
||||
case 'HIGH':
|
||||
w = 1280;
|
||||
h = 720;
|
||||
break;
|
||||
default:
|
||||
w = 640;
|
||||
h = 480;
|
||||
}
|
||||
mediaConstraints.video['width'] = { exact: w };
|
||||
mediaConstraints.video['height'] = { exact: h };
|
||||
//mediaConstraints.video['frameRate'] = { ideal: Number((<HTMLInputElement>document.getElementById('frameRate')).value) };
|
||||
}
|
||||
mediaConstraints.video['width'] = { exact: w };
|
||||
mediaConstraints.video['height'] = { exact: h };
|
||||
//mediaConstraints.video['frameRate'] = { ideal: Number((<HTMLInputElement>document.getElementById('frameRate')).value) };
|
||||
|
||||
return mediaConstraints;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,13 +34,14 @@ function hide(id: string) {
|
|||
export interface StreamOptions {
|
||||
id: string;
|
||||
connection: Connection;
|
||||
recvVideo: any;
|
||||
recvAudio: any;
|
||||
video: boolean;
|
||||
audio: boolean;
|
||||
recvVideo: boolean;
|
||||
recvAudio: boolean;
|
||||
sendVideo: boolean;
|
||||
sendAudio: boolean;
|
||||
activeAudio: boolean;
|
||||
activeVideo: boolean;
|
||||
data: boolean;
|
||||
mediaConstraints: any;
|
||||
audioOnly: boolean;
|
||||
}
|
||||
|
||||
export interface VideoOptions {
|
||||
|
@ -60,8 +61,8 @@ export class Stream {
|
|||
private videoElements: VideoOptions[] = [];
|
||||
private elements: HTMLDivElement[] = [];
|
||||
private speechEvent: any;
|
||||
private recvVideo: any;
|
||||
private recvAudio: any;
|
||||
private recvVideo: boolean;
|
||||
private recvAudio: boolean;
|
||||
private sendVideo: boolean;
|
||||
private sendAudio: boolean;
|
||||
private mediaConstraints: any;
|
||||
|
@ -71,7 +72,8 @@ export class Stream {
|
|||
private dataChannel: boolean;
|
||||
private dataChannelOpened = false;
|
||||
|
||||
private audioOnly = false;
|
||||
private activeAudio = true;
|
||||
private activeVideo = true;
|
||||
|
||||
private videoSrcObject: MediaStream | null;
|
||||
private parentId: string;
|
||||
|
@ -89,13 +91,14 @@ export class Stream {
|
|||
}
|
||||
|
||||
this.connection = options.connection;
|
||||
this.recvVideo = options.recvVideo;
|
||||
this.recvAudio = options.recvAudio;
|
||||
this.recvVideo = options.recvVideo || false;
|
||||
this.recvAudio = options.recvAudio || false;
|
||||
this.sendVideo = options.sendVideo;
|
||||
this.sendAudio = options.sendAudio;
|
||||
this.activeAudio = options.activeAudio;
|
||||
this.activeVideo = options.activeVideo;
|
||||
this.dataChannel = options.data || false;
|
||||
this.sendVideo = options.video;
|
||||
this.sendAudio = options.audio;
|
||||
this.mediaConstraints = options.mediaConstraints;
|
||||
this.audioOnly = options.audioOnly || false;
|
||||
|
||||
this.addEventListener('src-added', (srcEvent) => {
|
||||
this.videoSrcObject = srcEvent.srcObject;
|
||||
|
@ -365,7 +368,6 @@ export class Stream {
|
|||
if (!hasVideo) {
|
||||
constraints.video = false;
|
||||
this.sendVideo = false;
|
||||
this.audioOnly = true;
|
||||
this.requestCameraAccesAux(constraints, callback);
|
||||
} else {
|
||||
this.requestCameraAccesAux(constraints, callback);
|
||||
|
@ -379,22 +381,21 @@ export class Stream {
|
|||
this.cameraAccessSuccess(userStream, callback);
|
||||
})
|
||||
.catch(error => {
|
||||
// Try to ask for microphone only
|
||||
/*// Try to ask for microphone only
|
||||
navigator.mediaDevices.getUserMedia({ audio: true, video: false })
|
||||
.then(userStream => {
|
||||
constraints.video = false;
|
||||
this.sendVideo = false;
|
||||
this.audioOnly = true;
|
||||
this.sendAudio = true;
|
||||
this.cameraAccessSuccess(userStream, callback);
|
||||
})
|
||||
.catch(error => {
|
||||
this.accessIsDenied = true;
|
||||
this.accessIsAllowed = false;
|
||||
this.ee.emitEvent('access-denied-by-publisher');
|
||||
.catch(error => {*/
|
||||
this.accessIsDenied = true;
|
||||
this.accessIsAllowed = false;
|
||||
this.ee.emitEvent('access-denied-by-publisher');
|
||||
|
||||
console.error("Access denied", error);
|
||||
callback(error, this);
|
||||
});
|
||||
console.error("Access denied", error);
|
||||
callback(error, this);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -404,10 +405,10 @@ export class Stream {
|
|||
this.ee.emitEvent('access-allowed-by-publisher');
|
||||
|
||||
if (userStream.getAudioTracks()[0] != null) {
|
||||
userStream.getAudioTracks()[0].enabled = this.sendAudio;
|
||||
userStream.getAudioTracks()[0].enabled = this.activeAudio;
|
||||
}
|
||||
if (userStream.getVideoTracks()[0] != null) {
|
||||
userStream.getVideoTracks()[0].enabled = this.sendVideo;
|
||||
userStream.getVideoTracks()[0].enabled = this.activeVideo;
|
||||
}
|
||||
|
||||
this.wrStream = userStream;
|
||||
|
@ -438,7 +439,8 @@ export class Stream {
|
|||
this.openVidu.sendRequest("publishVideo", {
|
||||
sdpOffer: sdpOfferParam,
|
||||
doLoopback: this.displayMyRemote() || false,
|
||||
audioOnly: this.audioOnly
|
||||
audioActive: this.sendAudio,
|
||||
videoActive: this.sendVideo
|
||||
}, (error, response) => {
|
||||
if (error) {
|
||||
console.error("Error on publishVideo: " + JSON.stringify(error));
|
||||
|
@ -509,7 +511,7 @@ export class Stream {
|
|||
} else {
|
||||
let offerConstraints = {
|
||||
audio: this.recvAudio,
|
||||
video: !this.audioOnly
|
||||
video: this.recvVideo
|
||||
};
|
||||
console.debug("'Session.subscribe(Stream)' called. Constraints of generate SDP offer",
|
||||
offerConstraints);
|
||||
|
|
|
@ -43,13 +43,15 @@ public class ProtocolElements {
|
|||
public static final String JOINROOM_PEERID_PARAM = "id";
|
||||
public static final String JOINROOM_PEERSTREAMS_PARAM = "streams";
|
||||
public static final String JOINROOM_PEERSTREAMID_PARAM = "id";
|
||||
public static final String JOINROOM_PEERSTREAMAUDIOONLY_PARAM = "audioOnly";
|
||||
public static final String JOINROOM_PEERSTREAMAUDIOACTIVE_PARAM = "audioActive";
|
||||
public static final String JOINROOM_PEERSTREAMVIDEOACTIVE_PARAM = "videoActive";
|
||||
|
||||
public static final String PUBLISHVIDEO_METHOD = "publishVideo";
|
||||
public static final String PUBLISHVIDEO_SDPOFFER_PARAM = "sdpOffer";
|
||||
public static final String PUBLISHVIDEO_DOLOOPBACK_PARAM = "doLoopback";
|
||||
public static final String PUBLISHVIDEO_SDPANSWER_PARAM = "sdpAnswer";
|
||||
public static final String PUBLISHVIDEO_AUDIOONLY_PARAM = "audioOnly";
|
||||
public static final String PUBLISHVIDEO_AUDIOACTIVE_PARAM = "audioActive";
|
||||
public static final String PUBLISHVIDEO_VIDEOACTIVE_PARAM = "videoActive";
|
||||
|
||||
public static final String UNPUBLISHVIDEO_METHOD = "unpublishVideo";
|
||||
|
||||
|
@ -84,7 +86,8 @@ public class ProtocolElements {
|
|||
public static final String PARTICIPANTPUBLISHED_USER_PARAM = "id";
|
||||
public static final String PARTICIPANTPUBLISHED_STREAMS_PARAM = "streams";
|
||||
public static final String PARTICIPANTPUBLISHED_STREAMID_PARAM = "id";
|
||||
public static final String PARTICIPANTPUBLISHED_AUDIOONLY_PARAM = "audioOnly";
|
||||
public static final String PARTICIPANTPUBLISHED_AUDIOACTIVE_PARAM = "audioActive";
|
||||
public static final String PARTICIPANTPUBLISHED_VIDEOACTIVE_PARAM = "videoActive";
|
||||
|
||||
public static final String PARTICIPANTUNPUBLISHED_METHOD = "participantUnpublished";
|
||||
public static final String PARTICIPANTUNPUBLISHED_NAME_PARAM = "name";
|
||||
|
|
|
@ -128,7 +128,7 @@ public class NotificationRoomManager {
|
|||
* MediaElement...)
|
||||
*/
|
||||
public void publishMedia(ParticipantRequest request, boolean isOffer, String sdp,
|
||||
MediaElement loopbackAlternativeSrc, MediaType loopbackConnectionType, boolean audioOnly, boolean doLoopback,
|
||||
MediaElement loopbackAlternativeSrc, MediaType loopbackConnectionType, boolean audioActive, boolean videoActive, boolean doLoopback,
|
||||
MediaElement... mediaElements) {
|
||||
String pid = request.getParticipantId();
|
||||
String userName = null;
|
||||
|
@ -139,14 +139,14 @@ public class NotificationRoomManager {
|
|||
sdpAnswer = internalManager
|
||||
.publishMedia(request.getParticipantId(), isOffer, sdp, loopbackAlternativeSrc,
|
||||
loopbackConnectionType, doLoopback, mediaElements);
|
||||
internalManager.updateParticipantAudioOnly(pid, audioOnly);
|
||||
internalManager.updateParticipantStreamsActive(pid, audioActive, videoActive);
|
||||
participants = internalManager.getParticipants(internalManager.getRoomName(pid));
|
||||
} catch (OpenViduException e) {
|
||||
log.warn("PARTICIPANT {}: Error publishing media", userName, e);
|
||||
notificationRoomHandler.onPublishMedia(request, null, null, false, null, e);
|
||||
notificationRoomHandler.onPublishMedia(request, null, null, true, true, null, e);
|
||||
}
|
||||
if (sdpAnswer != null) {
|
||||
notificationRoomHandler.onPublishMedia(request, userName, sdpAnswer, audioOnly, participants, null);
|
||||
notificationRoomHandler.onPublishMedia(request, userName, sdpAnswer, audioActive, videoActive, participants, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,9 +154,9 @@ public class NotificationRoomManager {
|
|||
* @param request instance of {@link ParticipantRequest} POJO
|
||||
* @see RoomManager#publishMedia(String, String, boolean, MediaElement...)
|
||||
*/
|
||||
public void publishMedia(ParticipantRequest request, String sdpOffer, boolean audioOnly, boolean doLoopback,
|
||||
public void publishMedia(ParticipantRequest request, String sdpOffer, boolean audioActive, boolean videoActive, boolean doLoopback,
|
||||
MediaElement... mediaElements) {
|
||||
this.publishMedia(request, true, sdpOffer, null, null, audioOnly, doLoopback, mediaElements);
|
||||
this.publishMedia(request, true, sdpOffer, null, null, audioActive, videoActive, doLoopback, mediaElements);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -682,7 +682,7 @@ public class RoomManager {
|
|||
Set<UserParticipant> userParts = new HashSet<UserParticipant>();
|
||||
for (Participant p : participants) {
|
||||
if (!p.isClosed()) {
|
||||
userParts.add(new UserParticipant(p.getId(), p.getName(), p.getClientMetadata(), p.getServerMetadata(), p.isStreaming(), p.isAudioOnly()));
|
||||
userParts.add(new UserParticipant(p.getId(), p.getName(), p.getClientMetadata(), p.getServerMetadata(), p.isStreaming(), p.isAudioActive(), p.isVideoActive()));
|
||||
}
|
||||
}
|
||||
return userParts;
|
||||
|
@ -962,9 +962,10 @@ public class RoomManager {
|
|||
"No participant with id '" + pid + "' was found");
|
||||
}
|
||||
|
||||
public void updateParticipantAudioOnly(String pid, boolean audioOnly) {
|
||||
public void updateParticipantStreamsActive(String pid, boolean audioActive, boolean videoActive) {
|
||||
Participant p = this.getParticipant(pid);
|
||||
p.setAudioOnly(audioOnly);
|
||||
p.setAudioActive(audioActive);
|
||||
p.setVideoActive(videoActive);
|
||||
}
|
||||
|
||||
public void updateFilter(String roomId, String filterId) {
|
||||
|
|
|
@ -117,7 +117,7 @@ public interface NotificationRoomHandler extends RoomHandler {
|
|||
* accordingly.
|
||||
*/
|
||||
void onPublishMedia(ParticipantRequest request, String publisherName, String sdpAnswer,
|
||||
boolean audioOnly, Set<UserParticipant> participants, OpenViduException error);
|
||||
boolean audioActive, boolean videoActive, Set<UserParticipant> participants, OpenViduException error);
|
||||
|
||||
/**
|
||||
* Called as a result of {@link NotificationRoomManager#unpublishMedia(ParticipantRequest)}. The
|
||||
|
|
|
@ -30,7 +30,8 @@ public class UserParticipant {
|
|||
private String serverMetadata = "";
|
||||
private boolean streaming = false;
|
||||
|
||||
private boolean audioOnly = false;
|
||||
private boolean audioActive = true;
|
||||
private boolean videoActive = true;
|
||||
|
||||
private final String METADATA_SEPARATOR = "%/%";
|
||||
|
||||
|
@ -50,14 +51,15 @@ public class UserParticipant {
|
|||
this.streaming = streaming;
|
||||
}
|
||||
|
||||
public UserParticipant(String participantId, String userName, String clientMetadata, String serverMetadata, boolean streaming, boolean audioOnly) {
|
||||
public UserParticipant(String participantId, String userName, String clientMetadata, String serverMetadata, boolean streaming, boolean audioActive, boolean videoActive) {
|
||||
super();
|
||||
this.participantId = participantId;
|
||||
this.userName = userName;
|
||||
this.clientMetadata = clientMetadata;
|
||||
this.serverMetadata = serverMetadata;
|
||||
this.streaming = streaming;
|
||||
this.audioOnly = audioOnly;
|
||||
this.audioActive = audioActive;
|
||||
this.videoActive = videoActive;
|
||||
}
|
||||
|
||||
public UserParticipant(String participantId, String userName) {
|
||||
|
@ -106,12 +108,20 @@ public class UserParticipant {
|
|||
this.streaming = streaming;
|
||||
}
|
||||
|
||||
public boolean isAudioOnly() {
|
||||
return audioOnly;
|
||||
public boolean isAudioActive() {
|
||||
return audioActive;
|
||||
}
|
||||
|
||||
public void setAudioOnly(boolean audioOnly) {
|
||||
this.audioOnly = audioOnly;
|
||||
public void setAudioACtive(boolean active) {
|
||||
this.audioActive = active;
|
||||
}
|
||||
|
||||
public boolean isVideoActive() {
|
||||
return videoActive;
|
||||
}
|
||||
|
||||
public void setVideoACtive(boolean active) {
|
||||
this.videoActive = active;
|
||||
}
|
||||
|
||||
public String getFullMetadata(){
|
||||
|
|
|
@ -82,7 +82,8 @@ public class DefaultNotificationRoomHandler implements NotificationRoomHandler {
|
|||
if (participant.isStreaming()) {
|
||||
JsonObject stream = new JsonObject();
|
||||
stream.addProperty(ProtocolElements.JOINROOM_PEERSTREAMID_PARAM, "webcam");
|
||||
stream.addProperty(ProtocolElements.JOINROOM_PEERSTREAMAUDIOONLY_PARAM, participant.isAudioOnly());
|
||||
stream.addProperty(ProtocolElements.JOINROOM_PEERSTREAMAUDIOACTIVE_PARAM, participant.isAudioActive());
|
||||
stream.addProperty(ProtocolElements.JOINROOM_PEERSTREAMVIDEOACTIVE_PARAM, participant.isVideoActive());
|
||||
JsonArray streamsArray = new JsonArray();
|
||||
streamsArray.add(stream);
|
||||
participantJson.add(ProtocolElements.JOINROOM_PEERSTREAMS_PARAM, streamsArray);
|
||||
|
@ -127,7 +128,7 @@ public class DefaultNotificationRoomHandler implements NotificationRoomHandler {
|
|||
|
||||
@Override
|
||||
public void onPublishMedia(ParticipantRequest request, String publisherName, String sdpAnswer,
|
||||
boolean audioOnly, Set<UserParticipant> participants, OpenViduException error) {
|
||||
boolean audioActive, boolean videoActive, Set<UserParticipant> participants, OpenViduException error) {
|
||||
if (error != null) {
|
||||
notifService.sendErrorResponse(request, null, error);
|
||||
return;
|
||||
|
@ -140,7 +141,8 @@ public class DefaultNotificationRoomHandler implements NotificationRoomHandler {
|
|||
params.addProperty(ProtocolElements.PARTICIPANTPUBLISHED_USER_PARAM, publisherName);
|
||||
JsonObject stream = new JsonObject();
|
||||
stream.addProperty(ProtocolElements.PARTICIPANTPUBLISHED_STREAMID_PARAM, "webcam");
|
||||
stream.addProperty(ProtocolElements.PARTICIPANTPUBLISHED_AUDIOONLY_PARAM, audioOnly);
|
||||
stream.addProperty(ProtocolElements.PARTICIPANTPUBLISHED_AUDIOACTIVE_PARAM, audioActive);
|
||||
stream.addProperty(ProtocolElements.PARTICIPANTPUBLISHED_VIDEOACTIVE_PARAM, videoActive);
|
||||
JsonArray streamsArray = new JsonArray();
|
||||
streamsArray.add(stream);
|
||||
params.add(ProtocolElements.PARTICIPANTPUBLISHED_STREAMS_PARAM, streamsArray);
|
||||
|
|
|
@ -74,7 +74,8 @@ public class Participant {
|
|||
new ConcurrentHashMap<String, SubscriberEndpoint>();
|
||||
|
||||
private volatile boolean streaming = false;
|
||||
private volatile boolean audioOnly = false;
|
||||
private volatile boolean audioActive = true;
|
||||
private volatile boolean videoActive = true;
|
||||
private volatile boolean closed;
|
||||
|
||||
private InfoHandler infoHandler;
|
||||
|
@ -214,12 +215,20 @@ public class Participant {
|
|||
return streaming;
|
||||
}
|
||||
|
||||
public boolean isAudioOnly() {
|
||||
return this.audioOnly;
|
||||
public boolean isAudioActive() {
|
||||
return this.audioActive;
|
||||
}
|
||||
|
||||
public void setAudioOnly(boolean audioOnly) {
|
||||
this.audioOnly = audioOnly;
|
||||
public void setAudioActive(boolean active) {
|
||||
this.audioActive = active;
|
||||
}
|
||||
|
||||
public boolean isVideoActive() {
|
||||
return this.videoActive;
|
||||
}
|
||||
|
||||
public void setVideoActive(boolean active) {
|
||||
this.videoActive = active;
|
||||
}
|
||||
|
||||
public boolean isSubscribed() {
|
||||
|
|
|
@ -109,10 +109,11 @@ public class JsonRpcUserControl {
|
|||
if (roomManager.getRoomManager().isPublisherInRoom(participantName, roomName, pid)) {
|
||||
|
||||
String sdpOffer = getStringParam(request, ProtocolElements.PUBLISHVIDEO_SDPOFFER_PARAM);
|
||||
boolean audioOnly = getBooleanParam(request, ProtocolElements.PUBLISHVIDEO_AUDIOONLY_PARAM);
|
||||
boolean audioActive = getBooleanParam(request, ProtocolElements.PUBLISHVIDEO_AUDIOACTIVE_PARAM);
|
||||
boolean videoActive = getBooleanParam(request, ProtocolElements.PUBLISHVIDEO_VIDEOACTIVE_PARAM);
|
||||
boolean doLoopback = getBooleanParam(request, ProtocolElements.PUBLISHVIDEO_DOLOOPBACK_PARAM);
|
||||
|
||||
roomManager.publishMedia(participantRequest, sdpOffer, audioOnly, doLoopback);
|
||||
roomManager.publishMedia(participantRequest, sdpOffer, audioActive, videoActive, doLoopback);
|
||||
}
|
||||
else {
|
||||
System.out.println("Error: user is not a publisher");
|
||||
|
|
Loading…
Reference in New Issue